How to show/hide Actionbar when clicked on

android, android-actionbar, show-hide

Solution

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.

Problem

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? :)

Original source