摘要: package android.lekko.tools; import android.app.Activity; import android.content.ContentResolver; import android.provider.Settings; import android.provider.Settings.System; import android.view.WindowManager; import android.widget.Toast; public class LightnessControl { // 判断是否开启了自动亮度调节 pub... 阅读全文
posted @ 2013-03-24 19:06 Dive 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 第一步:首先创建一个广播接收者,重构其抽象方法 onReceive(Context context, Intent intent),在其中启动你想要启动的Service或app。 import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class BootBroadcastReceiver extends BroadcastRecei... 阅读全文
posted @ 2013-03-24 18:48 Dive 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 获取WifiManagerWifiManager wm = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);设置wifi功能开启bRet = wifiManager.isWifiEnabled();//判断是否开启bRet = wifiManager.setWifiEnabled(true);//设置开启关闭注意,调用setWifiEnabled后,系统进行wifi模块的开启需要一定时间,此时通过wifiManager.getWifiState()获取的状态来判断是否完成。 WifiManager.WIFI_STATE_DIS 阅读全文
posted @ 2013-03-24 18:44 Dive 阅读(611) 评论(0) 推荐(0) 编辑