For questions regarding programming in Android 12 (a.k.a., Android S), the primary 2021 version update for the Android OS.
Questions tagged [android-12]
563 questions
14
votes
3 answers
TelephonyManager deprecated listen() CALL_STATE_RINGING on android 12
I'd like to listen if there's a phone call happening while my app is in the foreground.
It was like this before but now listen() is deprecated:
val tm = context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
…

Orcun Sevsay
- 1,310
- 1
- 14
- 44
14
votes
5 answers
Android 12 splash screen before api 21
I'm trying to upgrade my application to target android 31 which introduces splash screen API so I followed the migration process mentioned here, but after migration the application doesn't run because splash screen API only supports android version…

Ramy Ibrahim
- 656
- 4
- 19
13
votes
4 answers
How to use or opt out in Android 12 SplashScreen
The new API SplashScreen in Android 12 seems good but just like before the sample code in the documentation does not really help explaining the whole and proper implementation. There is also some cases where you might do some task during splash…

Bitwise DEVS
- 2,858
- 4
- 24
- 67
12
votes
4 answers
Android 12 Splash Screen API - Increasing SplashScreen Duration
I am learning Android's new SplashScreen API introduced with Android 12. I have so far gotten it to work on my Emulator and Google Pixel 4A, but I want to increase its duration. In my Splash Screen I do not want a fancy animation, I just want a…

Andrew S
- 2,847
- 3
- 33
- 50
12
votes
1 answer
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED android 12
Getting the following error when trying to install the app in android 12 device.
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Error
Installation failed due to:…

Nitish
- 3,075
- 3
- 13
- 28
11
votes
4 answers
Missing mutability flags: Android 12 pending intents with NavDeepLinkBuilder
I´ve started testing my app for issues on Android 12, and have had some warnings regarding mutability flags on pending intents that are set up for a home screen widget. These mutability flags are now mandatory from SDK 31. Before 31, this code would…

Leknesh
- 307
- 2
- 10
11
votes
3 answers
Android 12 Pending Intent Immutable flag not available under API 23
Similar to this question, but not the same
After update to Android 12 (SDK 31) we change PendingIntent.getActivity(context, 0, intent, 0) to PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE) like suggested.
But…

Canato
- 3,598
- 5
- 33
- 57
10
votes
1 answer
Android 12 Battery optimization
I am trying to check if Android 12 is optimizing my app battery usage, so I used
isIgnoringBatteryOptimizations method (
https://developer.android.com/reference/android/os/PowerManager#isIgnoringBatteryOptimizations(java.lang.String)).
But…

AVEbrahimi
- 17,993
- 23
- 107
- 210
10
votes
2 answers
AudioManager auto switching own mode + not respecting setSpeakerphoneOn()
I want to play some audio with volume lvl adjusted to ear aka. "phone call mode". For this purpose, I'm using well-known and commonly advised
audioManager.setMode(audioNormalState ?
AudioManager.MODE_NORMAL :…

snachmsm
- 17,866
- 3
- 32
- 74
10
votes
4 answers
Unable to get WIFI SSID using onCapabilitiesChanged in Android 12
Description
I am unable to get WIFI SSID using the onCapabilitiesChanged in the ConnectivityManager.NetworkCallback class in Android-12.
In Android-12, getConnectionInfo is deprecated. So, as the android document suggests I am trying to get the…

Chirag Bhuva
- 851
- 7
- 14
9
votes
4 answers
Ionic android 12 splash error while adding cordova-android@11
Since Google raised the minimum sdk to 31 on the Google play console I had to make some changes and updates to Android 12, but when I try to add a new Android platform android@11 I have had this error regarding the flash that has changed on…

user8706852
- 135
- 1
- 8
9
votes
1 answer
'getter for connectionInfo: WifiInfo!' is deprecated. Deprecated in Java (Api 31)
When I want to get info about current wifi connection via WifiManager.connectionInfo I get
this:
'getter for connectionInfo: WifiInfo!' is deprecated. Deprecated in Java
How can I do it in Android 12? (only want to get rssi)

Renattele Renattele
- 1,626
- 2
- 15
- 32
8
votes
6 answers
Flutter : INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI
My flutter app isn't install on Android 12 version. I tried with android:exported, but nothing work. It's show me this type of error-
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk... …

Abir Ahsan
- 2,649
- 29
- 51
8
votes
2 answers
Back Button is not Resulting in onDestroy for Android 12
I have just started insuring my apps work with Android 12. What I notice is that for (I believe) all of them when the back button is pressed, then onPause() is called, but not onDestroy(). This means the app is still running.
Previously, onDestroy()…

Kenneth Evans
- 2,179
- 19
- 26
8
votes
7 answers
Android paho mqtt crashes Android 12 - Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE
I am using 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5' for mqtt service and the app keeps crashing on android 12 devices with the following crash logs
java.lang.IllegalArgumentException: app id: Targeting S+ (version 31 and above)…

Joseph Ofem
- 304
- 2
- 15