StupidBeauty
Read times:650Posted at:Fri Jun 21 00:36:07 2013
- no title specified

转载:Android开发中如何实现开机自启动

安卓软件要想开机自启动的话,需要监听BOOT_COMPLETED这个广播。另外还需要注意,有些管家型的系统软件会阻止后台服务开机自启动的。

http://iaiai.iteye.com/blog/1076152

亮点:

接下来,我们只需要在应用程序配置文件AndroidManifest.xml中注册这个Receiver来监听系统启动事件即可,如下所示:

Java代码

  1. 1.<receiver android:name=".service.BootReceiver">

  2. 2. <intent-filter>

  3. 3. <!-- 系统启动完成后会调用-->

  4. 4. <action android:name="android.intent.action.BOOT_COMPLETED">

  5. 5. </action>

  6. 6. </intent-filter>

  7. 7.</receiver>

捆得像电磁铁线圈一样

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4