Cannot Find Symbols

Started by
1 comment, last by Beastinlosers 7 years, 10 months ago

I am trying to follow this android tutorial for developing a flashlight.

Here is my code: http://pastebin.com/0D29gFin <--Line 31 is the problem

Here is were my messages/logs/output/error stuff: http://pastebin.com/p4TtdvMH <-- Line 47 problem

Here is the tutorial:

Since I changed it (I had to edit the line of code that causes the problem in order to get no errors, which gave a different error) here was the error before hand:


Error:(31, 67) error: <anonymous com.airsoftbbstore.evan.flashlight.MainActivity$1> is not abstract and does not override abstract method onClick(View) in OnClickListener

And the original Line of code:


imageButton.setOnClickListener(new View.OnClickListener() {

At least I'm trying

Advertisement

The original code was correct. OnClickListener is an interface, you can't pass values in its anonymous class's constructor.

And your onCLick method has a capital L, that's why it can't override.

The original code was correct. OnClickListener is an interface, you can't pass values in its anonymous class's constructor.

And your onCLick method has a capital L, that's why it can't override.

I hate those stupid errors, thanks for the 2nd look :D

At least I'm trying

This topic is closed to new replies.

Advertisement