When mobile battery server mode on , testing my app i plug & unplug usb.. app activity restarting.. only with battery server mode on..
Asked
Active
Viewed 356 times
1
-
I guess you mean battery saving mode. I also guess when the "charger" is disconnected you get a "configuration change" like e.g. when the display orientation changes. You can read about [handling configuration changes](https://developer.android.com/guide/topics/resources/runtime-changes) in Android documentation or search Stack Overflow with that term. – Markus Kauppinen Jul 20 '21 at 14:32
-
thanks markus kauppinen, https://developer.android.com/guide/topics/manifest/activity-element i used android:configChanges= "uiMode" , and it worked – Sampath Bandara Jul 20 '21 at 14:49
1 Answers
1
Thank you all , i put to - uiMode to cofigChanges it worked
<activity android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mcc|mnc|uiMode"
android:name=".menu5"
android:launchMode="singleTask" />

Sampath Bandara
- 66
- 5