手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >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广播接收者实例

android开机自启动原理与实现案例(附源码)

Android对开机自启动的限制

android 搜索自动匹配关键字并且标红

Android屏蔽后退键的小例子

android程序启动画面-Splash

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

Android三种菜单实例分析

精品推荐
分类导航