Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show black preview screen in task manager on ICS

I want to show a black screen in the task manager preview under Ice Cream Sandwich, like the German 'finanzstatus' app does. It would be nice if someone could point me in the right direction.

like image 312
MOST2K2 Avatar asked Apr 02 '12 21:04

MOST2K2


Video Answer


1 Answers

Using FLAG_SECURE will block your app from screenshots, including the recent tasks list:

public class FlagSecureTestActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

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

    setContentView(R.layout.main);
  }
}
like image 68
CommonsWare Avatar answered Oct 01 '22 07:10

CommonsWare