I have a FLAG_SECURE
set for an activity (it contains sensitive data), but in one particular Fragment
I need to clear it (because od Android Beam).
Window window = getActivity().getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
This code clears the flag (I have it on the Fragment's onResume
callback), but the issue is, that it doesn't go into effect till next configuration change (screen rotation,...)
The same problem is with setting the flag once again when leaving the Fragment.
Does anybody know, what should I do to fix this? (I thought about Activity.recreate()
, that could work but I don't like the solution)
I don't want to create a separate Activity
for this particular screen if possible.