Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the snapshot shown by recent apps list?

In the newer versions of Android (> 3.0) there is an onscreen button that will display a list of the recent apps with their names and snapshots. Even though my app itself is password protected, this overview might show sensitive data in that snapshot. So is there any way to force a certain image (like a logo) to be shown rather than let the OS decide?

like image 254
Andreas Wiggers Avatar asked Feb 03 '12 14:02

Andreas Wiggers


People also ask

How do I change my recent apps on Android?

From the Home screen, tap the Recents icon. Tap More options (the three vertical dots), and then tap Settings. Tap the switch next to Show recommended apps to turn on or off.

What is recents screen?

The Recents screen (also referred to as the Overview screen, recent task list, or recent apps) is a system-level UI that lists recently accessed activities and tasks. The user can navigate through the list and select a task to resume, or the user can remove a task from the list by swiping it away.


2 Answers

The solution provided by Azat continues to be valid also in Lollipop.

Just a note, if you want to continue to not see snapshots in recent list for the entire app, ALL the implemented activities should specify in the onCreate() method the flag getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); before setContentView();

Otherwise a snapshot in the recent list will show the first activity without the flag if the user navigated through it.

like image 168
Davideas Avatar answered Oct 15 '22 14:10

Davideas


It seems to be impossible for now. There's a method called onCreateThumbnail but it is not used currently by the system I guess, since it is not called. I see two possible solutions:

1. To disable thumbnail on the activity containing sensitive data by adding FLAG_SECURE to your window: getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
2. To exclude your activities from recent apps, set android:excludeFromRecents attribute to true for activities in AndroidManifest.xml

like image 25
Azat Avatar answered Oct 15 '22 15:10

Azat