i know this one,
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
but it only prevents screenshot from current app/app which is used to disable screenshot [app/activity only]
later, i kind of get the code,
WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_SECURE,
PixelFormat.TRANSPARENT);
params.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
params.gravity = Gravity.CENTER;
mView = new LinearLayout(ctx);
View btn = new View(ctx);
mView.addView(btn);
wm.addView(mView, params);
from, Rizwan
but it shows different errors
so,