简体   繁体   中英

How to hide Android application from task switcher

I have application which I would like to hide from list of running processes (the 'recent' selector on Android 4.x). How can I accomplish that? I'd be grateful if anybody could point me to resources or overall architecture of the matter?

I'm fairly new to android so it took me some time to learn that selector window is called 'recent'. (also having difficulties navigating source code on grepcode and distinguishin between manufacturer originated processes/activities and the ones included in android main release).

I have vague understanding that the individual running elements are called tasks, but not sure how tasks and apk's / activities / services relate. There must be piece of code somewhere that selects whether a given process can be switched to, and represented in task manager.

I'd expect that rooting is required, or some manufacturer granted capability.

Just add this to your manifest:

<activity android:name="qualified.name.of.Activity" android:excludeFromRecents="true" ...>  

More on that here: http://developer.android.com/guide/topics/manifest/activity-element.html

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