如何使应用程序成为默认系统启动器? [英] How to make app as a default system launcher?

查看:199
本文介绍了如何使应用程序成为默认系统启动器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了启动器应用程序,这是我将其安装在设备android系统上时的第一次,它弹出带有两个选项的选择器对话框,即Always&就一次.我选择了始终",现在我的应用程序成为默认启动器,但是问题是当我更新应用程序时,系统再次弹出相同的选择器对话框,我不想显示该弹出窗口.如何将应用程序设置为默认系统启动器?为此,我需要创建系统级应用程序吗?

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>

推荐答案

无法更改用户首选项. Google不允许开发人员更改用户偏好.

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.

这篇关于如何使应用程序成为默认系统启动器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆