コード例 #1
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    menu.clear();
    getMenuInflater().inflate(R.menu.triplistmenu, menu);

    if (trip.isFreeTrip() == false && trip.isEmpty() == false) {
      menu.findItem(R.id.triplistMenuCalendar).setVisible(true);
    }

    return true;
  } // onCreateOptionsMenu
コード例 #2
0
  /** Initializes the activity. */
  private void init() {
    db = DBFactory.getInstance(context);
    res = getResources();

    if (getIntent().getParcelableExtra("trip") != null) {
      trip = (Trip) getIntent().getParcelableExtra("trip");
      title = (TextView) findViewById(R.id.triplabel);
      title.setText(trip.getLabel());
    } else {
      debug(0, "No trip supplied.. exit activity");
      this.finish();
    }
    debug(2, "FreeTrip=" + trip.isFreeTrip());

    lv = getListView();
    lv.setOnItemLongClickListener(new DrawPopup());
    poiAdapter = new PoiAdapter(this, R.layout.plan_listitem, pois);
    lv.setAdapter(poiAdapter);

    for (Poi p : trip.getPois()) {
      pois.add(p);
    }
  } // init