hp_201111 |
2020-10-04 17:59 |
以下内容来自 https://www.jianshu.com/p/9b8b30f5ae6e 或许可以试试。 Android launcher 初体验--app开机启动 一个项目需求,要求定制的 APP 开机启动,并且只能使用这个 APP ,在网上搜了很多资料。 说将APP做成 launcher 替换掉 系统的 launcher 就可以开机启动,并只能使用这个APP了。 一. 简易 launcher 的开发 只需要在自己开发的APP的AndroidManifest中添加两句代码: <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> 这样一个简单的launcher APP 就搞定了,是不是太简单了。 在安装完成以后重启手机,系统会让选择是使用系统的 launcher 还是自己的 launcher 选择始终以后每次开机就会启动自己的launcher APP,这样做是简单,但弊端是: 用户如果卸载了这个APP或恢复出厂设置以后,那么就会启用系统的 launcher 。 做不到防止修改的作用。
|
|