Method undefined error in Android Activity

后端 未结 2 1584
[愿得一人]
[愿得一人] 2021-01-29 14:55

I\'m trying to make a simple Android application based on a guide. I am using the code below, but it is giving me several errors. It is complaining while trying to override the

相关标签:
2条回答
  • 2021-01-29 15:28
    import android.app.Activity;
    
    public class CheatActivity extends Activity {
    

    You should extend from Activity class. Because you are just creating new class without any methods which can be overridden from parent class.

    0 讨论(0)
  • 2021-01-29 15:31

    As Anatol said, you have to add extends Activity.

    If you didn't know that, the only method you have is implemented when extending from Activity.

    I would recommend you to create Activities with your IDE's wizard. And you will avoid having to add them manually to the manifest and adding unimplemented methods.

    0 讨论(0)
提交回复
热议问题