Search code examples
androidsecuritybackgroundtasklist

Hide app content when overview button clicked


I would like to be able to hide the content of the app when it is not in foreground, for example, when I click the overview button(task list), the Chase banking app would just show pure solid color and hide all the content. Does anyone know how to do this?

Example of what I want to achieve, show blank instead of a snapshot of the app


Solution

  • I found out the answer should be add the following in onCreate of activity. This also block user from taking screen shots of the activity.

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);