@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Get item selected and deal with it
    switch (item.getItemId()) {
      case android.R.id.home:
        // called when the up affordance/carat in actionbar is pressed
        mActivity.getNavigationDrawerFragment().setDrawerIndicatorEnabled(true);
        mActivity.restoreActionBar();
        getActivity().getSupportFragmentManager().popBackStack();
        return true;
    }

    return super.onOptionsItemSelected(item);
  }
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   this.mActivity = (MainActivity) activity;
   mActivity.setTitle(R.string.detail);
 }
 private void performSearch() {
   ListOfBooks.this.restartLoader();
   MainActivity.hideKeyboard(getActivity());
 }