Skip to content Skip to sidebar Skip to footer

Flag_secure Not Working On Libgdx's Androidapplication

I have an Android game created with help of libGDX. I want to disable the ability to take screenshots. For regular android activities you can use getWindow().setFlags(LayoutParams

Solution 1:

Calling initialize in AndroidApplication sets up the window parameters for a full-screen game, so it's overwriting your window parameters. So instead, put this in onCreate after you call initialize. Note that you should use addFlags instead of setFlags so you don't mess up the other flags that Libgdx set.

getWindow().addFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);

Post a Comment for "Flag_secure Not Working On Libgdx's Androidapplication"