user1221987
user1221987

Reputation: 121

Can screenshot's be disabled in an android app?

I am curious to know if screenshots can be disabled when running a android app if I were to design one.

Upvotes: 0

Views: 186

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006819

You are welcome to use FLAG_SECURE to block screenshots and thumbnails of your activities:

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

Upvotes: 2

Related Questions