Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show/hide Actionbar when clicked on [closed]

When the user clicks anywhere on the screen, I want the Actionbar to hide and when pressed again it should reappear.

I know there is something called actionbar.hide(); and show, but can you please help me how to implement it? :)

like image 889
ymerdrengene Avatar asked Dec 05 '22 12:12

ymerdrengene


1 Answers

Just hide():

getActionBar().hide();

when you want to hide it, and use show():

getActionBar().show() 

when you want to show it. That's about it.

Remember that if you're using View.SYSTEM_UI_FLAG_FULLSCREEN, this will not work properly.

like image 68
Raghav Sood Avatar answered Dec 31 '22 03:12

Raghav Sood