android - My app doesn't show in recent apps l

2019-09-16 03:00发布

问题:

I am working on an app and have just realised it doesn't show in the recent apps list.

I have 2 activities in the app and no matter which I am on when I hit the Home key, the app isn't shown in the recent apps list.

I have seen this question: SO Question but putting the category stuff in the manifest hasn't worked for me.

Below is the part of my manifest:

<application android:label="@string/app_name" >

    <service android:name=".UploadService" android:exported="false" />
    <service android:name=".DownloadService" android:exported="false" />

    <activity android:label="@string/app_name"
        android:excludeFromRecents="true"
        android:screenOrientation="portrait" 
        android:name="com.test.DOHSMain" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name="com.test.DOHSChange"
        android:label="@string/app_name" >
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>

Does anyone have any idea what I am doing wrong?

Note: I added the tag on the second activity DOHSChange just in case that would help but having that line there or not seems to do nothing.

Thanks for your time

回答1:

Get rid of android:excludeFromRecents="true" from your manifest



回答2:

You have android:excludeFromRecents=true in your launcher activity.