<TextView
style="@android:style/Widget.DeviceDefault.EditText"
android:id="@+id/time_start"
+ android:freezesText="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="showDateTimePickerDialog"
<TextView
style="@android:style/Widget.DeviceDefault.EditText"
android:id="@+id/date_start"
+ android:freezesText="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="showDateTimePickerDialog"
<TextView
style="@android:style/Widget.DeviceDefault.EditText"
android:id="@+id/time_end"
+ android:freezesText="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="showDateTimePickerDialog"
<TextView
style="@android:style/Widget.DeviceDefault.EditText"
android:id="@+id/date_end"
+ android:freezesText="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="showDateTimePickerDialog"
import android.app.Fragment;
import android.app.FragmentTransaction;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
public class AddEventTabListener implements ActionBar.TabListener {
public Fragment fragment;
private Event ev;
switch (tabId) {
case 0:
ev.title=fragment.getView().findViewById(R.id.eventtitle).toString();
+ String start=fragment.getView().findViewById(R.id.date_start).toString()+ " " +
+ fragment.getView().findViewById(R.id.time_start).toString();
+ String end=fragment.getView().findViewById(R.id.date_end).toString()+ " " +
+ fragment.getView().findViewById(R.id.time_end).toString();
+ try {
+ Date s=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(start);
+ Date e=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(end);
+ ev.dtstart=s.getTime();
+ ev.dtend=s.getTime();
+ } catch (ParseException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
break;
case 1:
ev.description=fragment.getView().findViewById(R.id.description).toString();