读写系统设置
Android的很多设置想关的东西都存储在数据库中
android的Settings.System.java中设置了很多相关属性
例如:
/** * 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 */ public static final String AUTO_TIME = "auto_time"; /** * Display times as 12 or 24 hours * 12 * 24 */ public static final String TIME_12_24 = "time_12_24"; /** * Date format string * mm/dd/yyyy * dd/mm/yyyy * yyyy/mm/dd */ public static final String DATE_FORMAT = "date_format";
//取 public static int getInt(ContentResolver cr, String name, int def); public static int getInt(ContentResolver cr, String name); //写 public static boolean putInt(ContentResolver cr, String name, int value);
public static Uri getUriFor(String name)System.java还提供了一个方法(getUriFor(String name)
<uses-permission android:name = "android.permission.WRITE_SETTINGS"/>