Use my own Android app/apk as launcher/Home Screen Replacement

风格不统一 提交于 2019-12-17 10:43:10

问题


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?


回答1:


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>

See the Intents and Intent Filters documentation from Google.




回答2:


You can take a look at the home tutorial http://developer.android.com/resources/samples/Home/index.html



来源:https://stackoverflow.com/questions/8248213/use-my-own-android-app-apk-as-launcher-home-screen-replacement

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