Question

I know that I can change the Settings with:

Settings.System.putInt( getContentResolver() , 
         Settings.System.SCREEN_OFF_TIMEOUT , DELAY );

but I honestly can't find a solution on how to read the current value of that / any setting.

Was it helpful?

Solution

check out http://developer.android.com/reference/android/provider/Settings.System.html

getInt(ContentResolver cr, String name, int def) Convenience function for retrieving a single system settings value as an integer.

OTHER TIPS

It's not allowed to read/write settings by non-system apps from Android 10.

https://developer.android.google.cn/about/versions/10/privacy/changes#non-resettable-device-ids

Starting in Android 10, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device's non-resettable identifiers, which include both IMEI and serial number.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top