title: Date picker on click (Like Google Calendar )
body: <p>so i want a time and a date picker to pop up when i click on a button look google Calendar does when you press the fab button on the bottom right. There will be a new window which shows up a date and a time and when you click one of them a picker opens.</p>
  
  <p>Im not sure if i need to create a fragment with a time picker in it and just make the size smaller or if i have to create one via code.</p>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>public class NewEventActivity extends AppCompatActivity {
  
      private LayoutInflater inflater;
      private String[] arraySpinner;
      private Button date_from;
      private Button date_to;
      private Button time_from;
      private Button time_to;
      private EditText title;
      private EditText invite;
  
  
  
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.new_event_fragment);
          findviewbyids();
          initPickers();
  
      }
  
      public void findviewbyids(){
          date_from    = (Button) findViewById(R.id.bt_date_from);
          time_from    = (Button) findViewById(R.id.bt_time_from);
          date_to  = (Button) findViewById(R.id.bt_date_to);
          time_to  = (Button) findViewById(R.id.bt_time_to);
          title  = (EditText) findViewById(R.id.et_title);
          invite  = (EditText) findViewById(R.id.et_invite);
  
      }
  
      public void initPickers(){
          Date today = new Date();
          DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
          DateFormat tf = new SimpleDateFormat("HH:mm:ss");
  
  
          String reportDate = df.format(today);
          String reportTime = tf.format(today);
  
          date_from.setText(reportDate);
          time_from.setText(reportTime);
          date_to.setText(reportDate);
          time_to.setText(reportTime);
  
          date_from.setVisibility(View.VISIBLE);
          date_to.setVisibility(View.VISIBLE);
          time_from.setVisibility(View.VISIBLE);
          time_to.setVisibility(View.VISIBLE);
  
          date_from.setBackgroundColor(Color.TRANSPARENT);
          date_to.setBackgroundColor(Color.TRANSPARENT);
          time_from.setBackgroundColor(Color.TRANSPARENT);
          time_to.setBackgroundColor(Color.TRANSPARENT);
  
          Spinner group = (Spinner) findViewById(R.id.sp_group);
  
          this.arraySpinner = new String[] {
                  "1", "2", "3", "4", "5"
          };
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_spinner_item, arraySpinner);
          group.setAdapter(adapter);
  
  
          date_from.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
  
              }
          });
      }
  }
  </code></pre>
  
  <p>now when i click on the <strong>date_from</strong> button a datePicker should appear and after setting the date it should overwrite the text on <strong>date_from</strong></p>
  
  <p>i hope you get what i mean</p>