Reputation: 1549
I am installing an app(say app1) progamatically from other app(say app2). All I am trying is that app1 is not displayed in main menu of the device and could be started only by the app2. If this is possible how could I implement this.Please help?
Upvotes: 0
Views: 114
Reputation: 39406
This is quite easy. In your manifest, there is usually an Activity. This Activity has an intent-filter. The entry point of your application contains an intent-filter that looks like:
<intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
If you don't put those 2 values in the intent-filter, your activity does not appear on the main menu.
Yet, you can still call it directly via any other kind of intent-filter.
Upvotes: 1
Reputation: 418
Replace
<category android:name="android.intent.category.LAUNCHER"/>
in the manifest of app1 with
<category android:name="android.intent.category.DEFAULT" />
Then it will be launched from app2 and wont be displayed in the application list(main menu)
Upvotes: 1
Reputation: 24820
The app1 manifest should not contain any component with
<category android:name="android.intent.category.LAUNCHER"/>
then it will not be displayed in the Launcher
Upvotes: 2