According to https://developer.android.com/about/versions/11/behavior-changes-11#toasts, Toasts should still work as normal for Android11 (only setView() was deprecated).
Note that text toasts are still allowed; these are toasts created using Toast.makeText() that don't call setView().
However, I cannot get Toast to show for emulators running SDK30 with
compileSdkVersion 30
buildToolsVersion "30.0.3"
and with targetSdkVersion 30
The code used was just a simple
Toast.makeText(getApplicationContext(), "HELLO WORLD", Toast.LENGTH_SHORT).show();
The toast is displayed when I change the targetSdk to 29 (or with devices <SDK30).
Do I need to add any <queries> tags in manifest file for Toasts ? https://developer.android.com/about/versions/11/privacy/package-visibility
I've also tried the following without luck.
- rebooting the emulator Toast not showing in Android Q
- notification ON Toast message not shown