I'm working on an Android app for a security-conscious employer. He's concerned about the screen snapshot that appears on the Overview Screen (a.k.a. the recent-tasks list) leaking sensitive information, and wants me to put up the program's splash screen before the system takes that picture. Unfortunately I haven't found any way to do so.
Things I've tried:
onPause
function. (No effect, even with bringToFront
and setVisibility(View.VISIBLE)
.)onCreate
and use bringToFront
in onPause
. (Again, no effect.)setVisible(false)
in onPause
. (Seemed to almost work, in that the screen blinks to black for an instant when switching away from the program, but it's apparently made visible by the system again before the snapshot.)setVisibility(View.INVISIBLE)
on the topmost item of the View in onPause
. (Seems like it will work, but the snapshot is apparently taken before it takes effect.)I'm a moderately accomplished Android developer, but I can't help but feel that there's a simple solution that I'm missing.
Based on @D.Maul 's answer but the Java version, instead of adding a view, I have tried this. It works fairly but sometimes the recent snapshot shows the app content not sure what to do about it.
private Dialog dialog = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
dialog = new Dialog(this, android.R.style.Theme_Light);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.customlaunch);
}
@Override
protected void onPause() {
dialog.show();
super.onPause();
}
@Override
protected void onResume() {
dialog.hide();
super.onResume();
}
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