@Override public boolean handlesBackKey() { if (mActvSearch.getVisibility() == View.VISIBLE) { hideSearch(); return true; } else { return false; } }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.action_search) { if (mActvSearch.getVisibility() == View.VISIBLE) { hideSearch(); } else { showSearch(); } return true; } else if (item.getItemId() == R.id.action_sync) { DBRemote.getInstance().startFullSyncThread(); return true; } else if (item.getItemId() == R.id.action_all_off) { Intent i = new Intent(getActivity(), ActivityAllOff.class); startActivity(i); } return false; }