Beispiel #1
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   if (!mNavigationDrawerFragment.isDrawerOpen()) {
     restoreActionBar();
     return true;
   }
   return super.onCreateOptionsMenu(menu);
 }
Beispiel #2
0
  @Override
  public void onBackPressed() {
    if (mNavigationDrawerFragment.isDrawerOpen()) {
      mNavigationDrawerFragment.closeDrawer();
      return;
    }

    if ((System.currentTimeMillis() - exitTime) > 2000) {
      Toast.makeText(this, "再按一次退出V2EX", Toast.LENGTH_LONG).show();
      exitTime = System.currentTimeMillis();
    } else {
      finish();
    }
  }