This worked for me on a Samsung Tab 2 7"
Using the following approach, to simply add the FLAG_SECURE
to the Window Flags
public class FlagSecureTestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(LayoutParams.FLAG_SECURE,
LayoutParams.FLAG_SECURE);
setContentView(R.layout.main);
}
}
with the caveat that you may need to change
LayoutParams
to
WindowManager.LayoutParams
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…