It should be
private OnClickListener mPictureListener = new OnClickListener() {
public void onClick (DialogInterface, int) {
If you're using eclipse, on the line with an error, click on the little
[x] on the left and it'll give you some options and auto fill in the
functions you need.
AFuzzyLlama wrote:
> When I compile code like this:
>
> onCreate(){
> ...
> CheckBox checkbox = (CheckBox) findViewById(R.id.picture);
> checkbox.setOnClickListener(mPictureListener);
> ...
> }
>
> private OnClickListener mPictureListener = new OnClickListener() {
> public void onClick(View v) {
> CheckBox checkbox = (CheckBox) findViewById(R.id.picture);
> //Perform action on clicks
> if (checkbox.isChecked()) {
> Toast.makeText(omoidasu.this, "Selected",
> Toast.LENGTH_SHORT).show();
> } else {
> Toast.makeText(omoidasu.this, "Not selected",
> Toast.LENGTH_SHORT).show();
> }
> }
> };
>
> I get this error at compile time:
>
> "The type new DialogInterface.OnClickListener(){} must implement the
> inherited abstract method DialogInterface.OnClickListener.onClick
> (DialogInterface, int)"
>
>
> Anyone able to help a beginner out? Much appreciated.
>
> _K
>
>
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---