Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove activity from recent apps list on finish?

I'm launching an activity from a service and want it to appear in the recent apps list.

However, I want the activity to be removed from the recent apps list if I exit the application (e.g. press button on activity's UI which calls finish()).

Excluding the activity from the recent apps list with android:excludeFromRecents="true" does not give me the initial activity behaviour that I require, i.e. the activity appearing in the recent apps list.

Is this possible?

like image 505
PJL Avatar asked Feb 19 '14 09:02

PJL


People also ask

How do I clear my recently used apps?

Large thumbnails of recently used apps display with each app's icon. To remove an app from the list, hold your finger down on the thumbnail for the app you want to remove until a popup menu displays. Touch “Remove from list” on that menu. NOTE: Notice the “App info” option available on the popup menu.

Can you clean my recent app?

Swipe down, settings, Advanced, double press home key, select the option for recent apps. So when you want to clear all the recently used apps, double press the home key, and then close all. Swipe down, settings, Advanced, double press home key, select the option for recent apps.

How do I hide recent tabs on apps?

you can put whatever apps you want to hide on the same Home Screen(s) and hide that specific screen. tap + hold the Home Screen to enter “jiggle mode” then tap the dots at the bottom in the center; this opens the “edit pages” screen where you can put a check mark under the pages you want visible / hidden.


1 Answers

Use

android:excludeFromRecents="true"

for the activity in manifest file

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".

like image 172
Raghunandan Avatar answered Oct 11 '22 14:10

Raghunandan