系统闹钟程序知识点记录

1、Settings.system

这种系统属性我们经常用到,例如飞行模式的开启和关闭,我们就是去改变Settings.system.AIRPLANE_MODE_ON 的值。

String nextAlarm = Settings.System.getString(getContentResolver(),  Settings.System.NEXT_ALARM_FORMATTED); //取得系统设定的值

 写入值则使用 Settings.System.putInt 

这种方式会保存变量到Settings 数据库中,飞行模式等的开关就是用这种方式实现的。

在AndroidManifest.xml中包含权限:
<uses-permission android:name=”android.permission.WRITE_SETTINGS” />


2、设置activity的主题为:android:theme="@android:style/Theme.Wallpaper“或者其子主题,activity显示时会有从右到左的动画效果,并且是以壁纸为背景。


你可能感兴趣的:(android,数据库,String)