How to make app as a default system launcher?

▼魔方 西西 提交于 2019-12-07 17:43:54

问题


I have developed the launcher application, for the first time when I installed it on device android system pop up chooser dialogue with two options i.e. Always & Just once. I selected "Always" now my app becomes default launcher but issue is when I update the app, the system pop up the same chooser dialogue again, I don't want to show that pop up. How to make the app as a default system launcher? To achieve this, Do I need to create system level app?

I have used following permission to make the app a launcher

<intent-filter>
 <action android:name="android.intent.action.MAIN" />               
 <category android:name="android.intent.category.HOME" />
 <category android:name="android.intent.category.DEFAULT" />
 <category android:name="android.intent.category.MONKEY" />
</intent-filter>

回答1:


It is not possible to change the user preferences. Google does not allow developer to change user preferences.

A workaround may be useful, you can check for if your application is default launcher through a service and then prompt user to choose your application as default.

You can find how to check if your application is the default launcher from here (tried this one, it works for me) or here

Then you can prompt the user to select your application if it is not the default launcher. A workaround to do so is given here.



来源:https://stackoverflow.com/questions/26422208/how-to-make-app-as-a-default-system-launcher

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!