4

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 remove it from "Recent Apps List" after closing my application programmatically. Please can you share your suggestions.

Manoj
  • 3,947
  • 9
  • 46
  • 84
  • I don't think there's a way to do it. What's the problem with that? – Sudarshan Bhat Dec 04 '12 at 14:10
  • thanks. If I close my application after click home button, that activity will resume when I click it from Recent Apps. But I don't want to resume that activity. I want to start one default activity when the user clicks from Recent Apps. – Manoj Dec 04 '12 at 14:17

4 Answers4

16

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

Siddharth Lele
  • 27,623
  • 15
  • 98
  • 151
2

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

<activity android:name=".MainActivity"
          android:excludeFromRecents="true" ...
0

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

Rotem
  • 1,472
  • 2
  • 11
  • 18
0

In your AndroidManifest.xml, use this for Activity:

<activity
    android:name="Your Activity"
    android:excludeFromRecents="true"
    android:noHistory="true"
    android:taskAffinity="">
</activity>
Jared Rummler
  • 37,824
  • 19
  • 133
  • 148
Atul Bhardwaj
  • 6,647
  • 5
  • 45
  • 63