Hello!

I'm learning how to develop Android applications. I make vspylvayuschie windows.

Toast.makeText(this, "Нажата кнопка ОК", Toast.LENGTH_LONG).show(); 

It turns out this error:

The method of makeText (Context, CharSequence, int) in the type.

What could be the problem. Click on the button I implement via the interface:

 OnClickListener oCickBtnOk = new OnClickListener() 

Thank!

1 answer 1

You, probably, Toast.makeText(this, "Нажата кнопка ОК", Toast.LENGTH_LONG).show(); wrote in an anonymous class? Try to implement the interface by activating, like this:

 public class MainActivity extends ActionBarActivity implements OnClickListener 

Or write MainActivity.this instead of this.

  • one
    Man, you are handsome! Save me from a sleepless night! THANK! - duddeniska
  • Well, instead of MainActivity, insert the name of your activity. And it is better to post your full code full in the topic header - as I guess something. - arg