0

I am hiding the status bar on click of ListView item in getView method.But when I am hiding status bar then getview method called .It should not be called. Here is my code :-

getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

This line I have added. How to prevent from calling getview method when hide status bar.

Thanks in advance.

Prudhvi
  • 2,276
  • 7
  • 34
  • 54
user2101858
  • 99
  • 1
  • 10

1 Answers1

1

Once the status bar is hidden your UI needs to be redrawn, as there's more space now. It's perfectly normal that you get calls to getView.

You can either hide the status bar before drawing the list, or clean up your getView method from whatever problems that occur if they need to be redrawn.

Note: To hide the status bar for android 4.1+ you can use:

View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
Simas
  • 43,548
  • 10
  • 88
  • 116