首页 > 移动平台 > 详细

Android自启动应用添加

时间:2018-05-08 11:54:48      阅读:188      评论:0      收藏:0      [点我收藏+]

本篇介绍Android开机自动启动应用的开发过程。

1:添加自启动权限

在AndroidManifest.xml添加权限

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

2:添加自启动接收,决定用哪个BroadcastReceiver作为应用入口

在AndroidManifest.xml添加入口

<receiver android:name="com.zpd.scanadapter.BootUp" >
<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>

BootUp的实现

public class BootUp extends BroadcastReceiver {

@Override

    public void onReceive(Context context, Intent intent) {
        //在此启动应用
    }

}

 

Android自启动应用添加

原文:https://www.cnblogs.com/ouyanghy/p/9007221.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!