Hey,

I am attampting this tutorial from the official android dev site andI
am getting the following error: "The method setOnClickListener
(View.OnClickListener) in the type View is not applicable for the
arguments (new DialogInterface.OnClickListener(){})"  I checked and
rechecked the code aginst what it is telling me to put in and it looks
right, but it is still giving this error.  Cn anyone tell me what I am
missing?

Here is the following code:

package hello.form.stuff;

import android.app.Activity;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;


public class HelloFormStuff extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final ImageButton btn = (ImageButton)this.findViewById
(R.id.android_button);

        btn.setOnClickListener(new OnClickListener()
        {
            public void onClick(View v)
            {
                // Perform action on clicks
                Toast.makeText(HelloFormStuff.this, "Beep Bop",
Toast.LENGTH_SHORT).show();
                }


        });

    }
}

Thanks,

Tim

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to