@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_item_new_event: Event event = new Event(); EventLab.get(getActivity()).addEvent(event); Intent intent = EventPagerActivity.newIntent(getActivity(), event.getId()); startActivity(intent); return true; case R.id.menu_item_my_events: Intent intent1 = MapsActivity.newIntent(getActivity()); startActivity(intent1); return true; default: return super.onOptionsItemSelected(item); } }
public void bindEvent(Event event) { mEvent = event; mTitleTextView.setText(mEvent.getTitle()); mDescriptTextView.setText(mEvent.getDescription()); mLocTextView.setText(mEvent.getLoc()); mDateTextView.setText("Date: " + DateFormat.format("dd/MM/yyyy", mEvent.getDate())); mEvent = event; mTitleTextView.setText(mEvent.getTitle()); mTimeTextView.setText("Time: " + DateFormat.format("hh:mm", mEvent.getTime())); }
@Override public void onClick(View v) { Intent intent = EventPagerActivity.newIntent(getActivity(), mEvent.getId()); true_id = mEvent.getId(); startActivity(intent); }