Android - Remove application from Recent Apps

前端 未结 4 1390
-上瘾入骨i
-上瘾入骨i 2020-12-19 22:56

I am developing an android application. If I close my application, my app available in the \"Recent Apps\" List. Now I don\'t want to show it in \"Recent Apps\". How can I r

相关标签:
4条回答
  • 2020-12-19 23:37

    In you Manifest.xml, set the following to your Root Activity

    <activity
        android:name=".Your_Root_Activity_Name"
        android:excludeFromRecents="true"
        .... 
    </activity>
    

    Depending on the results, you might also have to use the android:noHistory="true" attribute. But not sure if it is required in your case.

    For more information about this: http://developer.android.com/guide/topics/manifest/activity-element.html

    0 讨论(0)
  • 2020-12-19 23:40

    In your AndroidManifest.xml, use this for Activity:

    <activity
        android:name="Your Activity"
        android:excludeFromRecents="true"
        android:noHistory="true"
        android:taskAffinity="">
    </activity>
    
    0 讨论(0)
  • 2020-12-19 23:44

    Add excludeFromRecents="true" to your activity in AndroidManifest.xml:

    <activity android:name=".MainActivity"
              android:excludeFromRecents="true" ...
    
    0 讨论(0)
  • 2020-12-19 23:47

    override the onResume methods in your other Activities and there destroy them and call the main Activity.

    0 讨论(0)
提交回复
热议问题