Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top