title: Displaying Pickers on Android
body: <p>I'm trying to use the pickers in order the users to be able to select the hour. I create one FragmentActivity with the corresponding android XML. The FragmentActivity is the following:</p>
  
  <pre><code>public class MainActivity extends FragmentActivity{
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      TimePickerFragment tpf = new TimePickerFragment();
      tpf.getFragmentManager();
  
  }
  
  
  public static class TimePickerFragment  extends DialogFragment implements TimePickerDialog.OnTimeSetListener {
  
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {
   final Calendar c = Calendar.getInstance();
   int hour = c.get(Calendar.HOUR_OF_DAY);
   int minute = c.get(Calendar.MINUTE);
  
   return new TimePickerDialog(getActivity(), this, hour,minute,DateFormat.is24HourFormat(getActivity()));
  }
  
   public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
     // Do something with the time chosen by the user 
   }
  
   public void showTimePickerDialog(View v) {
     DialogFragment newFragment = new TimePickerFragment ();
     newFragment.show(getFragmentManager(), "timePicker");
   }
  
  }
  }
  </code></pre>
  
  <p>The XML is the following:</p>
  
  <pre><code> &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" &gt;
  
    &lt;Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"
     android:text="@string/hello_world" 
     android:onClick="TimePickerFragment " /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The code was retrieved from: <a href="http://developer.android.com/guide/topics/ui/controls/pickers.html" rel="nofollow">http://developer.android.com/guide/topics/ui/controls/pickers.html</a></p>
  
  <p>Now, the problem is that I'm not able to see the pickers with the date. It just display a white screen. What am I doing wrong?</p>
  
  <p>P.S. the only change that I have done, id that I use the  getFragmentManager() instead of the getSupportFragmentManager(). And this why,when I'm using the last one is hitting an error. </p>