Android window setFlags

972 views Asked by At

I tried to call setflags for a window in Android. I have an activity and several fragments. I want one of the fragments to have a different configuration. So I setflags in onCreate function for this fragment. But this doesn't work. I think the system need to reload the configuration for the window.

How can I do this?

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getActivity().getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
    }
}
0

There are 0 answers