Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Don't show my app in recent app

Tags:

android

I want Don't show my app in recent app when user run or close my app in hdevice

my purpose is: user Disabling to run my app

i am sorry for bad speak .

like image 942
abbasalim Avatar asked Apr 01 '14 07:04

abbasalim


3 Answers

Try this..

For your every activity android:excludeFromRecents="true"

<activity
        android:name=".Activity"
        android:excludeFromRecents="true" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

For more information refer this doc

like image 182
Hariharan Avatar answered Sep 28 '22 09:09

Hariharan


From Android Doc

Read this.

android:excludeFromRecents

Whether or not the task initiated by this activity should be excluded from the list of recently used applications ("recent apps"). That is, when this activity is the root activity of a new task, this attribute determines whether the task should not appear in the list of recent apps. Set "true" if the task should be excluded from the list; set "false" if it should be included. The default value is "false".

add android:excludeFromRecents="true" in your xml (AndroidManifest.xml) for the activity tag

like image 43
Marco Acierno Avatar answered Sep 28 '22 10:09

Marco Acierno


excludeFromRecents is what you are looking for. Just add this to your Activity tag in the AndroidManifest.xml:

android:excludeFromRecents="true"
like image 25
FD_ Avatar answered Sep 28 '22 10:09

FD_