public boolean isPowerSaveMode() { PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && powerManager.isPowerSaveMode()) { return true; } else { return false; } }
資料來源:
How to check if Android Lollipop battery saver is onhttps://stackoverflow.com/questions/31896826/how-to-check-if-android-lollipop-battery-saver-is-on
沒有留言:
張貼留言