1

On iOS if you press the home button of the device, iOS takes a screenshot of the current app screen. When switching back to the app it then shows that screen and while the screen is shown it really loads the actual app state. The increases perceived performance. The screenshot however can contain sensitive information (think of a banking app for instance). As the screenshot is saved unencrypted, some iOS apps remove sensitive information from the screen as soon as the app as backgrounded.

Does Android have a similar mechanism? If yes: how to prevent it or work around it?

Krumelur
  • 32,180
  • 27
  • 124
  • 263
  • The task switcher does show thumbnails. I believe there is a flag to a UI element which you can set to indicate that it contains sensitive information. – Chris Stratton Apr 17 '14 at 14:49
  • Duplicate of http://stackoverflow.com/questions/9822076/how-do-i-prevent-android-taking-a-screenshot-when-my-app-goes-to-the-background – ditkin Apr 17 '14 at 14:51

1 Answers1

0

Android doesn't do that. The application is still in memory but might be killed later. In that case everything will be restored with no screenshot taken by the system.

The only case where you want to hide sensitive information is when the user holds home button to show all running applications. You can hide the content of your activity where card details are entered by adding the following line in onCreate:

getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
azertiti
  • 3,150
  • 17
  • 19
  • Note it is no longer "holds the home button" - for quite a number of releases now, there has been a dedicated button for this. – Chris Stratton Apr 17 '14 at 14:57
  • Yes, true. I'm still used to say that since my device is using the old controls style :) – azertiti Apr 17 '14 at 14:59
  • Can you explain why you should hide sensitive information when the app overview is opened? – fweigl Apr 17 '14 at 15:07
  • That flag prevents your activity from being visible in screenshots both in app overview and when it's in foreground. It's just a recommended way of protecting sensitive data from applications that might want to access it. – azertiti Apr 17 '14 at 15:17