I am using an implementation of locker screen which locks (is displayed on top) the current activity when it is idle for X seconds. However the view for the locker activity is not displayed in the preview image after clicking the Home and Recent buttons.
How could I force to make my app's view blank or display my locker view in the recent list? I could set my activity visible to gone, but is there any other solution?
Try FLAG_SECURE:
public class FlagSecureTestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE);
setContentView(R.layout.main);
}
}
It will automatically display a grey background when Recents button is pressed.
A possible side-effect would be that you cant take the screenshot of the activity you are defining this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With