Question: I want to check `action bar` is hidden or visible when double tap on a `WebView`. My code is :

```
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
    if (getSupportActionBar().isShowing()){
        getSupportActionBar().hide();
    }else {
        getSupportActionBar().show();
    }

    //view.zoomIn();//Zoom in
    return true;
}

```

I want to check if action bar is visible.If its visible when double tap event occurs it should hide the action bar,

if it is hidden at first time then it should display the action bar when double tap occurs .

But above code generates error. so please help me to make a code working.

Answer: 
You must define your actionbar first. So 

```
ActionBar actionBar = getSupportActionBar();

```

Now you could do `actionBar.hide()` or `actionBar.show().`
There is no easy where to check if action bar is visible with the ActionBar instance. You should use Toolbar instead.

In your activity you can have.

```
public boolean isActionBarVisible(){
    return myToolbar.isShown();
}

```