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?
Update: it stopped working the next day :(
In all likelihood, this is an Android 12 bug because immediately after reboot everything works. But as soon as you change the build variants (from debug to release, for example), everything stops working.
And in the logcat I get the following error messages (while I'm trying to show only one Toast, I specifically double-checked):
Original answer
This combination worked for me:
1. Add
android:roundIcon
to manifest.Round icon can be generated in Android Studio:
Image Asset -> Launcher Icons (Adaptive and Legacy) -> Options -> Round Icon (API = 25) -> Generate: Yes
Also, if it's important, my icon asset is in PNG format.
2. Reboot the device.
After this, my app icon began to appear in Toast messages.
POCO X3 NFC, MIUI Global 14.0.2, Android 12.