- // Set the content view.
- setContentView(R.layout.about_coordinatorlayout);
-
- // We need to use the SupportActionBar from android.support.v7.app.ActionBar until the minimum API is >= 21.
- Toolbar aboutAppBar = (Toolbar) findViewById(R.id.about_toolbar);
- setSupportActionBar(aboutAppBar);
-
- // Display the home arrow on supportAppBar.
- final ActionBar appBar = getSupportActionBar();
- assert appBar != null;// This assert removes the incorrect warning in Android Studio on the following line that appBar might be null.
- appBar.setDisplayHomeAsUpEnabled(true);
+ // Disable screenshots if not allowed.
+ if (!allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }