开发者

update Android provider.Settings.System value

开发者 https://www.devze.com 2023-01-18 08:00 出处:网络
it seen i can\'t write to settings in LG-P500 (Android 2.2). This is my code: android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settin开发者_StackOverflow社区gs.System.AU

it seen i can't write to settings in LG-P500 (Android 2.2). This is my code:

android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settin开发者_StackOverflow社区gs.System.AUTO_TIME, 1); 

Value to specify if the user prefers the date, time and time zone to be automatically fetched from the network (NITZ). 1=yes, 0=no

It work fine in my emulator android 2.2 I also try in other phone, HTC android 2.1 it works fine too.

Could anyone know what would be the problem? Thank you very much.


You should add

<uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"></uses-permission>

to your AndroidManifest.xml files.

This should do the trick ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消