user2046848
user2046848

Reputation:

Android: How to convert my normal android application to android Launcher?

I have created my android application which shows all installed applications, widgets, now i can launch this application through android's default launcher but how can i launch it as launcher.

any suggestions?

Upvotes: 4

Views: 2306

Answers (3)

El mago pol
El mago pol

Reputation: 11

For my Android 9 I had to add some additional lines to the intent filter:

            <intent-filter
            >
            <action
                android:name="android.intent.action.MAIN"
                >
            </action>
            <category
                android:name="android.intent.category.HOME"
                >
            </category>
            <category
                android:name="android.intent.category.DEFAULT"
                >
            </category>
            <category
                android:name="android.intent.category.MONKEY"
                >
            </category>
            <category
                android:name="android.intent.category.LAUNCHER_APP"
                >
            </category>
        </intent-filter>

Upvotes: 1

Shridutt Kothari
Shridutt Kothari

Reputation: 7394

You can specify android.intent.category.HOME category for your Activity Tag in manifest file, which activity you wanted to be launched as a Launcher Activity, like -

<activity android:name="com.domain.youractivityname">
      <intent-filter>
           <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />
           <category android:name="android.intent.category.HOME" />
      </intent-filter>
</activity>

Hope it helps. thanks.

Upvotes: 5

njzk2
njzk2

Reputation: 39386

You need to specifiy the HOME category in your manifest, such as :

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.HOME" />
</intent-filter>

Upvotes: 2

Related Questions