문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top