app disabling screenshot and screen recording user enabled methods code example
Example: android prevent screenshot in activity
import android.view.WindowManager.LayoutParams
override fun onCreate(savedInstanceState: Bundle?) {
// ...
window.setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE)
// ...
}