I'm looking for a way to have my app launch an activity when opened directly from the Android market, yet not maintain an activity in the launcher menu. I thought that by using the following settings, I would be able to achieve this:
<activity android:name="com.package.test.MyActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
However, it appears that with these settings the Activity seemingly doesn't even exist in the app - it cannot be opened from the market and doesn't appear in the launcher menu. However, by simply adding:
<category android:name="android.intent.category.LAUNCHER" />
the app does both. The problem is I do want the activity to run from the Market, but I don't want it in the launcher menu.
Can anyone enlighten me as to how this can be achieved?
To declare your activity, open your manifest file and add an <activity> element as a child of the <application> element. For example: <manifest ... > The only required attribute for this element is android:name, which specifies the class name of the activity.
The "main" activity is the activity that loads first and the rest of your application. Every application can have multiple activities, therefore you can list other activities to load and use later on but you can only have one "main" activity.
Activity is a single screen in an application, Activity performs the actions on the screen(UI)
Instead of LAUNCHER
, use android.intent.category.INFO
. Know that this is not used often, but an example is an add-on package like the Beautiful Widgets animations, where an informational screen beyond the Market listing is useful after the app is installed, but no harm will be done if the user never discovers this activity.
(See also this question.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With