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

26,042

Solution 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.

Solution 2

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

Share:
26,042
B770
Author by

B770

Updated on July 11, 2022

Comments

  • B770
    B770 almost 2 years

    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?

  • Sanket Kachhela
    Sanket Kachhela almost 11 years
    hello Jon and B770, i have successfully implemented lock screen as home screen replacement app. and i also targeting default home screen after unlocking logic by using setComponentEnabledSetting() . but this is working for me till i unlock once. means if i unlock first time than after not getting custom lock screen.. any help? thanks...
  • Jon Adams
    Jon Adams almost 11 years
    @SanketKachhela: The question and answer relate to home screen replacements; not lock screen replacements. You should ask a new Question with the code you have now, what you're seeing and need to solve, etc. See stackoverflow.com/faq#howtoask on how to ask a good question.
  • Sanket Kachhela
    Sanket Kachhela almost 11 years
    yes.. i implemented as home screen replacement and in unlock logic i disabled this home screen by using setComponentEnableSetting() and in meanifeast i have created activity alias to disable and enable action programetically. but after disabling i am getting only default home screen. any help plz... thanks
  • Jon Adams
    Jon Adams almost 11 years
    @SanketKachhela: It still sounds like that's another issue. I suggest asking it as a new Question.
  • isaganiesteron
    isaganiesteron almost 10 years
    This works flawlessy for me, but I then my home button does nothing oustide the lockscreen. Is this just me?
  • Sagar Nayak
    Sagar Nayak almost 8 years
    how can i do it programmatically . i am creating a screen lock app. it needs to disable the home button . so i need to set my app as the home screen temporarily .
  • StrikeForceZero
    StrikeForceZero over 7 years
  • Jon Adams
    Jon Adams over 7 years
    Google pulled this sample code from their documentation
  • Julian
    Julian over 5 years