input field date validations
<p>I have three fields </p>

<ol>
<li>Current Date</li>
<li>Next Due Date</li>
<li>Status, It is spinner having values open, close, all</li>
</ol>

<p>My java code is:</p>

<pre><code>    date_txtbx = (EditText) findViewById(R.id.date_txtbx);
        date_txtbx.setText(" "
                + String.valueOf(java.text.DateFormat.getDateTimeInstance()
                        .format(Calendar.getInstance().getTime())));

next_due_on_txtbx = (EditText) findViewById(R.id.next_due_on_txtbx);
        next_due_on_txtbx.setText(non_ticket_task.next_due_on);



       status = (Spinner) findViewById(R.id.status_spinner);
     // Create an ArrayAdapter using the string array and a default spinner layout
     ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
             R.array.Status_array, android.R.layout.simple_dropdown_item_1line);
     // Specify the layout to use when the list of choices appears
     adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
     // Apply the adapter to the spinner
     status.setAdapter(adapter);
</code></pre>

<p>I want that next due date is disable when user select close status and if user input next due date less than or equal to current date it display error message that "<strong>Please insert date that is greater than current date</strong>". How can it possible?? i just want these validations on <code>**EditText**</code>. Kindly guide. Any help would be appreciate.</p>

<p>apply condition:</p>

<pre><code>   next_due_on_txtbx = (EditText) findViewById(R.id.next_due_on_txtbx);
        next_due_on_txtbx.setText(non_ticket_task.next_due_on);
        if (next_due_on_txtbx.after(date_txtbx))
        {
            Context count;
            Toast.makeText(count, "Starting date cannot be before Current date", Toast.LENGTH_LONG).show();
        }
</code></pre>
