title: How to compare current date with selected date in android with java
body: <p>I am taking current date using the code like below</p>
  
  <pre><code>long millis=System.currentTimeMillis();
  java.sql.Date date=new java.sql.Date(millis);
  </code></pre>
  
  <p>And I am selecting date using</p>
  
  <pre><code>CalendarView cal.setOnDateChangeListener(new OnDateChangeListener() {
              @Override
              public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth)
  
  String s = +year + " : " + (month + 1) + " : " +dayOfMonth ;
  </code></pre>
  
  <p>and passing  it on next activity as--</p>
  
  <pre><code>Intent in = new Intent(MainActivity.this, sec.class);
  in.putExtra("TextBox", s.toString());
  startActivity(in);
  </code></pre>
  
  <p>I want to check here if user selected previous date from current date 
  then give a message and don't go on next activity.</p>