简体   繁体   中英

Remove application from Recent app while closing the activity

I have the requirement to close the activity as soon as it get launched,to achieve this i used finish() method, but it still exists in running application list.

Please suggest me some solution..

The activity you're calling the finish() method, is destroyed and all its resources are queued for garbage collection, because a reference to this activity becomes inaccessible. So, all memory that was used by this activity will be freed during next GC cycle. and by findihing teh activity, you are destroying the actviity not the app..

Please keep in mind :

Android keeps processes around in case the user wants to restart the app, this makes the startup phase faster. The process will not be doing anything and if memory needs to be reclaimed, the process will be killed. Don't worry about it :)

To remove your app from Recent app list : just specify android:excludeFromRecents="true" in the manifest

Refer this link for better explanation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM