Remove app from recent apps programmatically
Yes, generally when you want to have special properties for an Activity
when starting it you supply special flags to the Intent
. In this case FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
.
Updated:
If you need to hide the current already running activity, you might be able to use this flag in combination with FLAG_ACTIVITY_CLEAR_TOP
which would send the new Intent to the existing Activity
. You'll have to think and perhaps experiment with what happens as the user moves around your stack though and whether that will make your app re-appear in the recent apps.
Android - Remove application from Recent Apps
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
Exiting Android App: back vs recent apps--close
Do both close the app and remove it from memory?
No. Pressing BACK N times destroys N activities. It has no direct effect at all on your process, which will remain running for a time. Swiping your task off of the overview screen (a.k.a., recent-tasks list) will terminate your process.
Related Topics
Drawable-Hdpi, Drawable-Mdpi, Drawable-Ldpi Android
How to Get the Number of Unread Gmail Mails (On Android)
How to Remove All Listeners Added with Addtextchangedlistener
Disabling Android O Auto-Fill Service for an Application
Android - How to Enable Autostart Option Programmatically in Xiaomi Devices
How to Programmatically Clear Application Data
How to Draw Text with a Border on a Mapview in Android
Does the Android Art Runtime Have the Same Method Limit Limitations as Dalvik
Converting Activity into Fragment
How Does Evaluatejavascript Work
How to Enable Standard Copy Paste for a Textview in Android
Load an Image from Assets Folder
How to Call Methods of a Service from Activity
Autocompletetextview with Custom Adapter and Filter
How to Record Microphone to More Compressed Format During Webrtc Call on Android
Android Share Intent for a Bitmap - Is It Possible Not to Save It Prior Sharing