I do not know how to fix the error OnClickListener () in the java class below, only has it to fix
Here is the complete code to download: link
classeOlaCalendario.javapackagecom.example.brainiac.olacalendario;importandroid.annotation.TargetApi;importandroid.app.DatePickerDialog;importandroid.app.Dialog;importandroid.content.DialogInterface;importandroid.content.DialogInterface.OnClickListener;importandroid.icu.util.Calendar;importandroid.os.Build;importandroid.support.annotation.RequiresApi;importandroid.support.v7.app.AppCompatActivity;importandroid.os.Bundle;importandroid.view.View;importandroid.widget.Button;importandroid.widget.DatePicker;importandroid.widget.TextView;publicclassOlaCalendarioActivityextendsAppCompatActivity{privateTextViewmDateDisplay;privateButtonmPickDate;privateintmYear;privateintmMonth;privateintmDay;staticfinalintDATE_DIALOG_ID=0;protectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.ola_calendario);mDateDisplay=(TextView)findViewById(R.id.dateDisplay);mPickDate=(Button)findViewById(R.id.pickDate);mPickDate.setOnClickListener(newOnClickListener(){publicvoidonClick(Viewv){showDialog(DATE_DIALOG_ID);}});finalCalendarc=Calendar.getInstance();mYear=c.get(Calendar.YEAR);mMonth=c.get(Calendar.MONTH);mDay=c.get(Calendar.DAY_OF_MONTH);updateDisplay();}privatevoidupdateDisplay(){mDateDisplay.setText(newStringBuilder()//Monthis0basedsoadd1.append(mMonth+1).append("-")
.append(mDay + 1).append("-")
.append(mYear + 1).append(" "));
}
private DatePickerDialog.OnDateSetListener mDateSetListener=
new DatePickerDialog.OnDateSetListener(){
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
mYear = year;
mMonth = month;
mDay = dayOfMonth;
updateDisplay();
}
};
@Override
protected Dialog onCreateDialog(int id){
switch (id){
case DATE_DIALOG_ID:
return new DatePickerDialog(this,mDateSetListener, mYear, mMonth, mDay);
}
return null;
}
}
file ola_calendario.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/dateDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
/>
<Button
android:id="@+id/pickDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Altere a Data "
/>
</LinearLayout>'