<item android:id="@+id/deleteevent"
android:icon="@android:drawable/ic_menu_delete"
android:title="Delete Event"
- android:visible="true"
android:titleCondensed="DELETE"
android:showAsAction="always">
</item>
- <item android:id="@+id/NewEvent" android:title="New event"
- android:visible="true" android:showAsAction="ifRoom"
- android:icon="@android:drawable/ic_menu_add"
- android:titleCondensed="NEW">
- </item>
<item android:id="@+id/edit_event"
- android:title="@string/edit_event"
- android:visible="true"
- android:showAsAction="never">
-
+ android:title="@string/edit_event"
+ android:showAsAction="ifRoom">
</item>
- <item android:id="@+id/eventlist"
- android:title="@string/eventlist"
- android:visible="true"
- android:showAsAction="never" >
+ <item android:id="@+id/eventlist"
+ android:title="@string/eventlist"
+ android:showAsAction="ifRoom">
</item>
-
+ <item android:id="@+id/add_alarm"
+ android:title="@string/add_alarm"
+ android:icon="@android:drawable/ic_menu_add"
+ android:showAsAction="ifRoom">
+ </item>
</menu>
<string name="refresh">Refresh</string>
<string name="stop_alarm">Stop Alarm</string>
<string name="edit_event">Edit Event</string>
+ <string name="add_alarm">Add alarm</string>
<string-array name="repeat_array_s">
<item>Day</item>
<item>Until</item>
<item>Number of events</item>
</string-array>
-</resources>
\ No newline at end of file
+</resources>
public boolean onOptionsItemSelected(final MenuItem item) {
// Handle item selection
switch (item. getItemId()) {
- case R.id.NewEvent:
- final Intent i=new Intent(this,AddEventActivity.class);
- startActivity(i);
- return true;
- case R.id.deleteevent:
- final DeleteEventDialog d=new DeleteEventDialog(event,this);
- d.show(getFragmentManager(), "Delete");
- return true;
- case R.id.eventlist:
- final Intent it=new Intent(this,EventListActivity.class);
- startActivity(it);
- return true;
- case R.id.edit_event:
- AddEventActivity.editEvent(DisplayEventActivity.this,event);
- return true;
- default:
- return true;
+ case R.id.deleteevent:
+ final DeleteEventDialog d=new DeleteEventDialog(event,this);
+ d.show(getFragmentManager(), "Delete");
+ return true;
+ case R.id.eventlist:
+ final Intent it=new Intent(this,EventListActivity.class);
+ startActivity(it);
+ return true;
+ case R.id.edit_event:
+ AddEventActivity.editEvent(DisplayEventActivity.this,event);
+ return true;
+ case R.id.add_alarm:
+
+ return true;
+ default:
+ return true;
}
}
}