PowerManager powerManager = (PowerManager)getSystemService(Context.POWER_SERVICE);
boolean powerSaveMode = powerManager.isPowerSaveMode();
Docs: developer.android.com/…/PowerManager#isPowerSaveMode()
Added in API level 21
(Android 5.0)
More Related Contents:
- Android call api route every few seconds
- android studio app running on api level 23 but crashes on 19
- The constructor JSONArray(Object[]) is undefined
- Android studio error in stack trace
- Android SDK installation doesn’t find JDK
- I need an alternative option to HttpClient in Android to send data to PHP as it is no longer supported
- Using Retrofit in Android
- Converting json string to java object?
- Google Maps API and custom polyline route between Markers
- Android app crashes after SDK-tools update version (NoClassDefFound, tool version 22)
- Cannot connect to localhost API from Android app
- MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent
- Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle
- connect failed: ECONNREFUSED
- How to tell ProGuard to keep private fields without specifying each field
- Adding ListView Sub Item Text in Android
- How to get Android GPS location
- Creating an Android Lock Screen App.
- ListView random IndexOutOfBoundsException on Froyo
- Android: ClassNotFoundException when passing serializable object to Activity
- Using MessagePack with Android
- Android Spinner – How to make dropdown view transparent?
- Pass Serializable Object to Pending Intent
- JSONParser cannot be resolved to a type
- converting a date string into milliseconds in java [duplicate]
- Digest authentication in Android using HttpURLConnection
- Android 6.0 (Marshmallow): How to play midi notes?
- JSONObject.toString: how NOT to escape slashes
- Get the field value with a Cursor
- How to detect when button pressed and released on android