title: How to create Spinner to show current and next 30 dates
body: <p>How can I create a date Spinner, which shows current date in EditText as default and future dates in Spinner (like, for next 30 days)</p>
  
  <p>I used date picker in many apps, so I am familiar with date picker dialog but don't have any idea about date spinner.</p>
  
  <p><strong>Note</strong><br>
  Please don't tell me How to style EditText as Spinner</p>
  
  <p><strong>EDITED: 1</strong> AS RECOMMENDED BY <code>@erakitin</code></p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_date);
  
      Spinner spinnerDateIn = (Spinner) findViewById(R.id.spinnerDateIn);
      Spinner spinnerDateOut = (Spinner) findViewById(R.id.spinnerDateOut);       
  
      spinnerDateIn.setAdapter(new CalendarSpinnerAdapter(SpinnerDateActivity.this, 30));         
  
  }
  </code></pre>
  
  <p><strong>EDITED: 2</strong> AS RECOMMENDED BY <code>@erakitin</code> in new update</p>
  
  <pre><code>CalendarSpinnerAdapter mSpinnerDateInAdapter = new CalendarSpinnerAdapter(SpinnerDateActivity.this, 30);
          spinnerDate.setAdapter(mSpinnerDateInAdapter);
  
          spinnerDate.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  spinnerDate.setSelection(position);
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; parent) {
  
              }
          });
  </code></pre>
  
  <p>Now, trying to get value of selected Item in String but getting: <code>java.util.GregorianCalendar</code>, where i am doing mistake ?</p>
  
  <pre><code>strDate = spinnerDate.getSelectedItem().toString();
  </code></pre>