Need to hide content of program from Android “Overview Screen”

Personally, I would go with FLAG_SECURE, and simply block display of this stuff everywhere:

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);
  }
}

However, IIRC, you can override onCreateThumbnail() to supply your own image to use for the recent-tasks list. Note that this might have changed with Android 5.0, as they have overhauled that recent-tasks list, so be sure to test your code on a 5.0 device or emulator.

Leave a Comment