コード例 #1
0
 private void showContent(FragmentName name) {
   if (name == FragmentName.GUIDE && isBeaconScanServiceActive()) {
     // TODO show POI, if available
     name = FragmentName.GUIDE_RUNNING;
   }
   FragmentHelper.show(this, getFragmentManager(), name, activePOI);
 }
コード例 #2
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Pass the event to ActionBarDrawerToggle, if it returns
    // true, then it has handled the app icon touch event
    if (dToggle.onOptionsItemSelected(item)) {
      return true;
    }
    // Handle your other action bar items...
    if (item.getItemId() == R.id.stop_guide) {
      FragmentHelper.show(this, getFragmentManager(), FragmentName.GUIDE_STOPPED, null);
    } else if (item.getItemId() == R.id.action_ask_question) {
      startActivity(new Intent(getApplicationContext(), QuestionFormActivity.class));
    }

    return super.onOptionsItemSelected(item);
  }