I try to disable screenshot in current fragment,and enable it to others,for disable i use
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE) or getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE)
and for enable use
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
But this nor work,working only in Samsung galaxy s5
and more, in Galaxy s3
working only after fragment come from background, in htc m8s it dont work never!!!
And it always work when i gove flag before my main Activity setContentView
method,it work for all devices!I have only one Activity,and i want to disable screenShot only for one fragment!