title: Implementing DatePicker in Fragment
body: <p>I'am using Fragment which is an instance of Fragment and not of DialogFragment.</p>
  
  <p>I did google most of the search result shows how to use DialogFragment to have DatePicker.</p>
  
  <p>which isn't working in my case because of type mismatch of Fragment and DialogFragment</p>
  
  <p>Any example or idea would be helpful</p>
  
  <p><strong>Here is the Fragment Java Code</strong></p>
  
  <pre><code>        public class CreateReportFragment extends Fragment {
  
          public CreateReportFragment(){}
  
          public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
          {
  
                 rootView = inflater.inflate(R.layout.activity_create_report, container, false);
                 initViews();
                 return rootView;
          }
  
          private void initViews() 
         {
  
           final Calendar c = Calendar.getInstance();
               year  = c.get(Calendar.YEAR);
               month = c.get(Calendar.MONTH);
               day   = c.get(Calendar.DAY_OF_MONTH);
  
               editTextDate.setText(new StringBuilder()
               // Month is 0 based, just add 1
               .append(year)
               .append("-")
                      .append(month + 1)
                       .append("-").append(day));
  
          buttonDate = (Button)rootView.findViewById(R.id.buttonDate);
          }
  </code></pre>
  
  <p>How to implement <strong>DatePicker</strong> in <strong>Fragment</strong>?</p>