How can I get onBackPressed action while searchView is activated?
<p>How can I handle onBackPressed at search mode? I have implemented the search at the actionbar, and I want to handle onBackPressed.</p>

<p>EDIT:</p>

<p>at main activity I have added this, but it only gets notifyde when search is closed</p>

<pre><code>@Override
    public void onBackPressed() {
        mMenu.findItem(R.id.menu_eye).setVisible(true);
        mMenu.findItem(R.id.menu_layers).setVisible(true);
        super.onBackPressed();  
    };
</code></pre>

<p>and my listener for search action looks like this:</p>

<pre><code>import com.cyrilmottier.polaris.PolarisMapView;

import android.app.SearchManager.OnCancelListener;
import android.content.Context;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.SearchView;

public class SearchListener implements SearchView.OnQueryTextListener, SearchView.OnCloseListener, SearchView.OnSuggestionListener, OnClickListener, OnCancelListener{

    private Context mContext;
    private PolarisMapView mMapView;
    private Menu mMenu;
    private SearchView mSearchView;

    public SearchListener(Context c, PolarisMapView mMapView, Menu mMenu, SearchView mSearchView){
        this.setmContext(c);
        this.setmMapView(mMapView);
        this.setmMenu(mMenu);
        this.mSearchView = mSearchView;
    }

    @Override
    public boolean onQueryTextChange(String newText) {
        return false;
    }

    @Override
    public boolean onQueryTextSubmit(String query) {
        if (Constants.searchPlaceNavigate(query, mContext, mMapView))
            return this.onClose();
        return false;
    }

    public Context getmContext() {
        return mContext;
    }

    public void setmContext(Context mContext) {
        this.mContext = mContext;
    }

    public PolarisMapView getmMapView() {
        return mMapView;
    }

    public void setmMapView(PolarisMapView mMapView) {
        this.mMapView = mMapView;
    }

    @Override
    public boolean onSuggestionClick(int position) {
        String p = mSearchView.getSuggestionsAdapter().getCursor().getString(position);
        if(position== 0)
            p = mSearchView.getSuggestionsAdapter().getCursor().getString(position*4+1);
        if(p != null)
            if(position== 0)
                Constants.searchPlaceNavigate(mSearchView.getSuggestionsAdapter().getCursor().getString(position*4+1), mContext, mMapView);
            else
                Constants.searchPlaceNavigate(mSearchView.getSuggestionsAdapter().getCursor().getString(position), mContext, mMapView);
        return this.onClose();
    }

    @Override
    public boolean onSuggestionSelect(int position) {

        return false;
    }

    @Override
    public boolean onClose() {
        mMenu.findItem(R.id.menu_eye).setVisible(true);
        mMenu.findItem(R.id.menu_layers).setVisible(true);
        mMenu.findItem(R.id.menu_search).collapseActionView();
        return true;
    }

    public Menu getmMenu() {
        return mMenu;
    }

    public void setmMenu(Menu mMenu) {
        this.mMenu = mMenu;
    }

    public SearchView getmSearchView() {
        return mSearchView;
    }

    public void setmSearchView(SearchView mSearchView) {
        this.mSearchView = mSearchView;
    }

    @Override
    public void onClick(View v) {
        this.onClose();
    }

    @Override
    public void onCancel() {
        this.onClose();

    }

}
</code></pre>
