import android.view.MenuItem;
import android.view.View;
import android.widget.DatePicker;
+import android.widget.EditText;
import android.widget.TextView;
import android.widget.TimePicker;
case R.id.cancel:
finish();
return true;
+ case R.id.save:
+ Event e = getEvent(this);
+ return true;
default:
return false;
}
}
- public void showDateTimePickerDialog(final View v) {
+ private Event getEvent(final Activity v) {
+ //TODO get all information
+ final long _id=22;
+ final String organizer="";
+ final String title=((EditText)v.findViewById(R.id.eventtitle)).getText().toString();
+ final String eventLocation="";
+ final String description=((EditText)v.findViewById(R.id.description)).getText().toString();
+ final int eventColor=0;
+ final long dtstart=0;
+ final long dtend=0;
+ final long calendarID = 0;
+ System.out.print(title + description);
+ Event ret = new Event(_id,organizer,title,eventLocation,description,eventColor,dtstart,dtend,calendarID);
+ return ret;
+ }
+
+ public void showDateTimePickerDialog(final View v) {
dateTimeTextView=(TextView) v;
if(v.getId()==R.id.date_start || v.getId()==R.id.date_end || v.getId() == R.id.repeat_until)
new DatePickerFragment().show(getFragmentManager(), "datePicker");
/** Calendar ID */
public final long calendarID;
- private Event(final long _id, final String organizer, final String title, final String eventLocation, final String description, final int eventColor, final long dtstart, final long dtend, final long calendarID) {
+ public Event(final long _id, final String organizer, final String title, final String eventLocation, final String description, final int eventColor, final long dtstart, final long dtend, final long calendarID) {
this._id=_id;
this.organizer=organizer;
this.title=title;