user3162792
user3162792

Reputation:

How can I protect my screen to be captured?

I have some screens in my app and I want it be prevented by being captured from other apps, due to some confidential info.

Is there any way to do this?

Upvotes: 1

Views: 1995

Answers (1)

Kanak Sony
Kanak Sony

Reputation: 1560

Yes, there is a way provided by Android itself to disable screenshots, may be it can help.

http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE

In your activity -

 getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
            WindowManager.LayoutParams.FLAG_SECURE);

Upvotes: 14

Related Questions