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

烂漫一生 提交于 2019-12-13 04:14:50

问题


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.



来源:https://stackoverflow.com/questions/15119825/android-my-app-doesnt-show-in-recent-apps-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!