The app I\'m currently building has the requirement that the app has to prevent the OS to take a screenshot of the app when it\'s being pushed into the background for securi
This is work for me after adding these line into the onCreate before setContentView of every activity.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); setContentView(R.layout.activity_notification);