tags:

views:

98

answers:

2

I basically want to say

if the date is unchanged run this alert

my date field is set up like this

                StartDate = new DateField("Start Date ", DateField.DATE);
                cal1 = Calendar.getInstance();
                cal1.set(Calendar.YEAR, 2009);
                cal1.set(Calendar.MONTH, 3);
                cal1.set(Calendar.DAY_OF_MONTH, 1);
                StartDate.setDate(cal1.getTime());

and i have this but i am not sure where to begin to make it right.

        if(StartDate.equals(Calendar.DAY_OF_MONTH, 1))
        {

        AlertNameNotEntered.setString("Please select a Start Date");
        mDisplay.setCurrent(AlertNameNotEntered);
        }

Thanks

+1  A: 

It seems to me you have quite a few gaps in your knowledge regarding basic Java. There are no short-cuts to getting to know the language and the standard library. Consult javadocs for Calendar, Date and DateField classes.

javashlook
+1  A: 

I assume you want something like this:

if(StartDate.getDate().getTime() == cal1.getTime()) // Date is unchanged
  {
    AlertNameNotEntered.setString("Please select a Start Date");
    mDisplay.setCurrent(AlertNameNotEntered);
  }
Skip Head