Class Must Either Be Declared Abstract Or Implement Abstract Method Error
This is my code that is suppose to change some text on button press:- public class MyActivity extends ActionBarActivity { TextView txtview; Button butto; @Override
Solution 1:
View.OnClickListener
must implement the function onClick()
otherwise your class should be abstract, so that you could implement your onClick()
function in some child class. But in your case you have made a spelling mistake. It should be onClick()
instead of Onclick()
;
Solution 2:
You got the method name wrong :
public void Onclick(View paramView)
should be
public void onClick(View paramView)
Following Java naming conventions can help you.
Solution 3:
Tricks: add @Override
above onClick(View)
. Without @Override
, the warning means you didn't implement onClickListener
.
Post a Comment for "Class Must Either Be Declared Abstract Or Implement Abstract Method Error"