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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With