且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止Android应用程序在主屏幕上创建它的应用程序图标。

更新时间:2021-12-28 09:50:48

您希望用户如何打开您的应用程序?如果您不想显示图标,那么没有启动器活动是正确的方法。



例如,如果您想允许用户通过打开txt文件打开你的应用程序,你可以在你的清单中添加一个意图过滤器:



How do you want users to be able to open your application? If you don't want to show an icon, then not having a launcher activity is the correct way to do it.

For example if you want to allow users to open your application via opening a txt file, you could add an intent filter inyour manifest:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="text/*" />
</intent-filter>