7

Our Android app may present sensitive data and we wish to hide it when the app is not in use - Android is taking a snapshot of the app and displays it in the overview screen. At the same time we want to enable the user to take screen shots of the app when using it. We already checked following options:

  1. Using FLAG_SECURE - Answers the need to hide the app in the overview screen but completely blocks the user from taking any screen shot of the app
  2. Using onPause to change the activity content. Specifically we tried to show there the splash screen. We do see the splash screen appears when the app is minimizing, but the thumbnail presents the app before the splash appeared, meaning this is too late.

Any idea how we can hide/change the activity before the app moves to the background and still keep the print screen ability when the user is using the app?

Here are some links about the issue - all are only partial to this question:

Thanks!

Community
  • 1
  • 1
SBStack
  • 146
  • 8
  • Is it possible to set FLAG_SECURE in onPause() and take it out in onResume()? – David Corsalini Feb 20 '15 at 15:49
  • Already tried that and it did not work :-( – SBStack Feb 20 '15 at 15:54
  • How about implementing the snapshot function in the app? Then you could use the FLAG_SECURE and let the user take a screenshot by capturing the UI frame through code. But that of course will also have impact on usability. – Micky Feb 20 '15 at 16:08

1 Answers1

1

Is removing the app from recent apps completely an option? Then set android:excludeFromRecent to true for the activity.

Micky
  • 5,578
  • 7
  • 31
  • 55
  • Thanks for the suggestion, but it will hurt the user experience, as the user is expecting the app to be there. Looking for a better solution (it is so simple in iOS and I am hoping to find some kind of a solution to android) – SBStack Feb 20 '15 at 16:03
  • Strangely Android does not offer a proper way to handle this and eventually I chose using the [android:excludeFromRecent](http://developer.android.com/guide/topics/manifest/activity-element.html#exclude) setting as @Kim suggested. Hopefully at some point Android will answer this basic issue. – SBStack Feb 25 '15 at 14:17