Background
I'm making an activity that has 2 fragments.
the second fragment shows a full screen image, which also hides the status bar (AKA notification bar) using:
final View decorView = getActivity().getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_LOW_PROFILE;
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN)
uiOptions |= View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
The problem
I'm trying to add a sharing dialog of the currently shown image, but no matter which method I try to do it, it always shows the status bar, making things "jumpy".
What I've tried
The normal way to open the sharing dialog didn't work (I mean, it worked, but it showed the status bar) :
startActivity(Intent.createChooser(shareIntent,"some text");
So I had to create my own popup.
First I wanted to show some sort of progressDialog, but it also caused the status bar to show, so I removed it.
Then I wanted to show a list of the items, so I used ListPopupWindow (anchored to the view the user is clicking) , but it also showed the status bar. Another thing I tried is to use the normal PopupWindow and set a listView inside of it, but it also didn't help.
Another thing that I tried is to change the window of the popupWindow to have the same settings as the fragment's activity, but it also didn't help.
I even tried to set a smaller height for the popup, but it didn't help.
The question
How can I use a PopupWindow (or the normal sharing dialog) so that the status bar will remain in the same state as it did before showing it?