tags:

views:

212

answers:

2

I'm going through the Android hello world application examples and have got stuck on the date picker example. I think I have followed the instructions properly but don't understand the following error

DatePickerDialog.OnDateSetListener(){} must implement the inherited abstract method DatePickerDialog.OnDateSetListener.onDateSet

At first I typed it in but have now I have copied the code over from the example:

// the callback received when the user "sets" the date in the dialog
private DatePickerDialog.OnDateSetListener mDateSetListener =
        new DatePickerDialog.OnDateSetListener() {

            public void onDateSet(DatePicker view, int year, 
                                  int monthOfYear, int dayOfMonth) {
                mYear = year;
                mMonth = monthOfYear;
                mDay = dayOfMonth;
                updateDisplay();
            }
        };

but still get the error.

Sorry for probably newbie type error but I can't figure out what this error is trying to tell me or what I could have done wrong?

A: 

No, I can't figure out either, someone help us!

Melissa
A: 

Hi, you must add the import:

import android.widget.DatePicker;

Fabio Pina