How to configure Toast icon in Android 12? - android

Starting with Android 12, Google show a toast message with an app icon.
My application have launcher icon. Android 12 splash screen show app icon correctly.
Show toast by code
Toast.makeText(this, "Show simple toast", Toast.LENGTH_LONG).show()
compileSdkVersion/targetSdkVersion 31
android emulator Google play Intel x86 Atom_64 System Image API Level 31, Revision 8.
How can i change this default toast icon?

For me a simple restart of the device did the trick.
I had not restarted my test phone after the update to Android 12 at all. I experienced the same odd bug that a generic app icon was shown in Toasts issued by my app. I tried changing the Manifest as Mickaël‘s answer suggested. No luck. I ended up with the exact same Manifest the app had before I started debugging … and then I restarted the device. My app now displays the correct icon in Toasts reliably. What happened? Unsure. I suspect that a restart may trigger an icon cache refresh that crawls all installed apps in search for new/updated app icons.

Seems like this issue was reported to Google, and assigned to a Google engineer:
https://issuetracker.google.com/issues/202863198

From me the restart of the phone work as well. The toasts now show the proper App Icon, configured in my apps. If it does not work for you please review this statement and check if everything is properly set for you app icon. I hope that this will help :)
https://developer.android.com/studio/write/image-asset-studio
PS: There is one more place from which you can build your app icons https://romannurik.github.io/AndroidAssetStudio/index.html

After running a few tests, I found that setting <application android:icon="#drawable/ic_stat_name" ... with a drawable generated with Image Asset > Notification Icons is overriding the default toast icon.
However, this doesn't work with a drawable generated as Image Asset > Launcher Icons. So at this point, I guess something is missing in Android Studio's generation tool.

Related

App started to crash after changing an icon

Once I changed an icon of my app by right clicking on res folder and going to New>Image asset, app started to crash on my Android 6.0 device. Then I watched a video that says that the 1st option "Launcher icon (Adaptive and Legacy)" is for Android 8.0 and I didn't understand what he said. And he said that "Launcher icon (Legacy only)" is for Android 7.1.1 and below. So, then I thought that the problem was that I used "Launcher icon (Adaptive and Legacy)" and my device is Android 6.0. Fortunately, I had backed up "mipmap" folders of default icon. But once I changed to default icon, my app is still crashing. Where a problem could be?

Android application home screen icon showing default android icon?

My applications are behaving oddly when deploying them on the phone. The application icon shows correctly in the applications drawer but in the home screen they show a default android icon. I think this has started happening since I updated to last android studio but I'm not sure of it. Before, everything was ok.
I have been researching this issue but could not find any info about it. Is anyone suffering from this problem? Have you found a solution?
Cheers.
I have seen this on some devices that appear to cache the app icon. In my experience deleting the app from the device and reinstalling has always cured it. This doesn't seem to be a problem when the app icon changes and the app is installed from Google Play, but only when installed via adb, so I don't believe users should see this problem.
I can not comment due to low reputation, so I'm asking that did you place the icon in following folder:
mipmap-mdpi
mipmap-hdpi
mipmap-xhdpi
mipmap-xxhdpi
if not then place your icon in these folder and check.
because now launcher icon should in these folders.
Hope this helps.
Thanks

Android Launcher Icon doesn't load

Doing a routine update to an app and decided to update the launcher icon as I have done many times before. However, I'm getting a very strange bug which I had once before but can't remember how I resolved.
I have the right sized icons in each drawable folder and in the manifest the name is correct:
android:icon="#drawable/ic_launcher"
When I try to update the app the old icon remains, on a fresh installation the default launcher icon shows.
I've tried:
Cleaning the project
Restarting Eclipse
Restarting my computer
Restarting the device
A different device
Adding a new set of icons using the Android Icon Set function
Adding a new set using a different filename and changing the name in the manifest
One stange thing that is worth pointing out, if I delete the file ic_launcher.png from a drawable folder, then rename another file to that filename I get this error:
This shouldn't show as the file doesn't exist. This error then shows if I click continue:
Any ideas?
EDIT:
It appears this issue is even more complex than I thought. If I install an app on the emulator the icon appears just fine, on a device it doesn't. If I install the app onto physical devices from the apk, on one device the icon appears and on the other the Package installer crashes!
It seem this is caused by a bug in newer versions of Android. The icons are indeed included in the apk and upload just fine to Play, however it takes a reboot to get them to be shown on my devices (I was wrong above where I said a reboot doesn't work). This means I need to reboot the devices each time I try and new icon, not the end of the world but certainly frustrating.
This problem exists on two different apps I have been working on and two different Nexus devices, I think since they were updated to 5.0.

Android Studio: Installing the APP on the smartphone

i got a little problem with installing my app on my smartphone. Its works normal when i am using the standart icon, but after changing the icon, Android studio starts the app on my smartphone normally, but i cant find the app in the app list.
What i am trying to say is that, I cant manually start the App, because its not showing on my Smartphone. Starting throuch Android studio works perfectly fine. I assume its because of my new icon, because the other work fine. I changed the Logo in the different Sizes and just exchanged the old icon with the new one.
Please post a snapshot of your code(xml,java and manifest), without which the forum is unable to help you.
You'll have to first update your icon in the drawable folder only then will you be able to use it in your app.

Android custom home for tablet

Im develping an app using apk 12 for 10.1 inch galaxy tablet. I would like to design a home screen only with my apps icon so that user will not be able to access anything else. Can I do that ? If yes, how ??
I would like to design a home screen only with my apps icon so that user will not be able to access anything else. Can I do that ?
Yes, it is possible to create a home screen application.
If yes, how ??
There is a Home sample app in your Android SDK installation (assuming you installed the samples from the SDK Manager). It largely boils down to having an activity with an <intent-filter> using CATEGORY_HOME.
Note that the user who installs your app will have the option of choosing between your home screen and the built-in one. Even if they make your home screen the default one, they will still be able to revert that decision by removing your app:
by booting in safe mode
via the Android SDK (e.g., adb uninstall)
by getting into Settings through notifications and the like
possibly other means
For ur knowledge lot many thing are diff for honeycomb.
For your knowledge, nothing changed in this area with Android 3.0.

Categories

Resources