手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >android开机自启动app示例分享
android开机自启动app示例分享
摘要:复制代码代码如下:/*开机自动启动APP*/publicclassBootReceiverextendsBroadcastReceiver{...

复制代码 代码如下:

/*开机自动启动APP*/

public class BootReceiver extends BroadcastReceiver {

@Override

public void onReceive(Context context, Intent intent) {

Log.d("XRGPS", "BootReceiver.onReceive: " + intent.getAction());

if (ACTION_BOOT_COMPLETED.equals(intent.getAction())) {

Intent mBootIntent = new Intent(context, MainActivity.class);

mBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

context.startActivity(mBootIntent);

} else {

Log.w("XRGPS", "BootReceiver: unsupported action");

}

}

}

【android开机自启动app示例分享】相关文章:

android 九宫格滑动解锁开机实例源码学习

Android对开机自启动的限制

Android重启运用程序的代码

android 弹出提示框的使用(图文实例)

android 开发 文件读写应用案例分析

android IntentService实现原理及内部代码分享

android dialog自定义实例详解

android 放大镜ShapeDrawable妙用分享

Android开发之软键盘用法实例分析

Android开场动画实例类Java代码

精品推荐
分类导航