用我自己的Andr​​oid应用程序/ APK的发射器/主屏幕更换自己的、发射器、用我、应用程序

2023-09-12 23:46:39 作者:[ 玩命卟玩心 ]

我已经创建了自己的应用程序,我想这个是我的发射。这是一个简单的应用程序,但它的作品。

I've created my own app and I want this one to be my launcher. It's a simple app, but it works.

是否有可能与我的应用程序替换默认的启动,使我的应用程序总是启动后开始默认?

Is it possible to replace the default launcher with my app so that my app always starts by default after booting?

推荐答案

设置在清单中的正确意图过滤器将允许它可以提示你使用它作为替代:

Setting the correct intent filters in your manifest will allow it be prompt you to use it as a replacement:

<activity android:name="Home"
            ...
            android:launchMode="singleInstance"
            android:stateNotNeeded="true">
    <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME"/>
            <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

请参阅Android的指南,并查看样品的主屏幕更换应用和的意图和意图过滤器文档来自谷歌。

See the Android guides, and review the sample home screen replacement app and Intents and Intent Filters documentation from Google.