让应用程序开机即可启动,可以参考Launcher的配置文件设置
1、在activity都android:name 下加入
android:launchMode ="singleTask"
android:clearTaskOnLaunch = "true"
android:stateNotNeeded = "true"
android:theme = "@style/Theme"
android:screenOrientation= "nosensor"
android:windowSOftINputMode="stateUnspecified|adjustPan"
2、把intene-filter 改为如下形式:
<intene-filter>
<action android:name ="android.intent.action.MAIN">
<category android:name = "android.intent.cetegory.HOME">
<category android:name = "android.intent.cetegory.DEFAULT">
</INTENT-FILTER>
3、把编译好的程序安装到系统中,并删除原有都Luancher2
本文介绍了如何通过配置Launcher的活动启动模式、意图过滤器等,实现应用程序在开机时自动启动的功能,包括设置launchMode、clearTaskOnLaunch、stateNotNeeded、theme、screenOrientation和windowSOftInputMode等属性。
503

被折叠的 条评论
为什么被折叠?



