Date and time picker. Work in progress
[unical.git] / src / ro / ieval / unical / AddEventActivity.java
index 42aa2f2ca4da591fbfb88d073d4edf7c9c055554..5606b65fca91679c93bfc561e585160ea5d18c05 100644 (file)
@@ -1,11 +1,13 @@
 package ro.ieval.unical;
 import android.app.ActionBar;
 import android.app.Activity;
+import android.app.DialogFragment;
 import android.app.Fragment;
 import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
+import android.view.View;
 
 public final class AddEventActivity extends Activity {
        @Override
@@ -60,4 +62,15 @@ public final class AddEventActivity extends Activity {
                                return false;
                }
        }
+       
+       public void showTimePickerDialog(View v) {
+               if(v.getId()==R.id.date_start || v.getId()==R.id.date_end) {
+                       DialogFragment newFragment = new DatePickerFragment();
+                       newFragment.show(getFragmentManager(),"datePicker");
+               }
+               else {
+                       DialogFragment newFragment = new TimePickerFragment();
+                       newFragment.show(getFragmentManager(), "timePicker");
+               }
+       }
 }
This page took 0.009547 seconds and 4 git commands to generate.