コード例 #1
0
  @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);
  }
コード例 #2
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   this.mActivity = (MainActivity) activity;
   mActivity.setTitle(R.string.detail);
 }
コード例 #3
0
 private void performSearch() {
   ListOfBooks.this.restartLoader();
   MainActivity.hideKeyboard(getActivity());
 }