手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >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 FM播放时拔出耳机后FM APP自动close解决方法

android 放大镜ShapeDrawable妙用分享

android TextView属性的详细介绍 分享

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

android dialog自定义实例详解

Android获取通话时间实例分析

android生命周期深入分析(二)

Android开场动画实例类Java代码

Android 自动化测试经验分享 深入UiScrollable

精品推荐
分类导航