android 开机启动_关机_重启
来源:百度文库 编辑:神马文学网 时间:2024/10/02 19:10:28
file 1 :(采用BroadcastReceiver 发送广播可以在每次开机时跑到你指定的class)
public class Boot_Receiver extends BroadcastReceiver {
@Override
public void onReceive(Context context,Intent intent){
Intent i=new Intent(Intent.ACTION_RUN);
i.setClass(context,C.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
file 2 :(shutdown 功能的实现)
case R.id.Coldboot : {
mPowerCycleType="Coldboot";
Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
intent.putExtra(Intent.EXTRA_KEY_CONFIRM, false);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}break;
(restart功能的实现)
case R.id.Warmboot : {
mPowerCycleType="Warmboot";
//Get the current system time
mTime=GetSystemDate().toString();
boot_SharedPreferences_put();
Intent i=new Intent();
i.setClass(B.this,C.class);
startActivity(i);
}break;
AndroidManifest.xml :(声明权限)
package="wistron.mojo"
android:sharedUserId="android.uid.system"
>
。。。。。。。。
。。。。。。。。
public class Boot_Receiver extends BroadcastReceiver {
@Override
public void onReceive(Context context,Intent intent){
Intent i=new Intent(Intent.ACTION_RUN);
i.setClass(context,C.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
file 2 :(shutdown 功能的实现)
case R.id.Coldboot : {
mPowerCycleType="Coldboot";
Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
intent.putExtra(Intent.EXTRA_KEY_CONFIRM, false);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}break;
(restart功能的实现)
case R.id.Warmboot : {
mPowerCycleType="Warmboot";
//Get the current system time
mTime=GetSystemDate().toString();
boot_SharedPreferences_put();
Intent i=new Intent();
i.setClass(B.this,C.class);
startActivity(i);
}break;
AndroidManifest.xml :(声明权限)
android:sharedUserId="android.uid.system"
>
。。。。。。。。
。。。。。。。。
android 开机启动_关机_重启
开机后不断重启,不能正常启动
添加开机启动项的方法_系统攻防档案
电脑开机关机速度慢--怎样加速_四季被专卖.http://pjhq1688.cn.alib...
Android源码编译_
开机重启
Linux 关机重启流程分析
不关机重启IIS的方法
如何应对关机自动重启??
WinXP关机又自动重启
快速关机 重启只要一秒钟
XP的定时关机命令_
Android装机必备_Android专题_爱卓网
android 模拟器启动
Android 启动过程汇总
电脑开机慢怎么办?_口袋
解决电脑开机慢的方法_
智慧之道_重
人生不能重来_
如何才能让电脑快速关机与快速重启?
一秒钟关机及任务管理器的用法_
怎样把“你可以正常关机了”去掉_
XAMPP开机启动
开机自动启动samba