简体   繁体   中英

How to limit an android app not to be displayed in main menu of the device?

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?

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

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM