To disable Screen Capture:
Add following line of code in onCreate()
method:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE);
To enable Screen Capture:
Find for LayoutParams.FLAG_SECURE
and remove the line of code.