Method does not override method from its superclass

Asked

Viewed 1,457 times

5

I’m new in Java and I’m learning app for Android and on my way, I ran into this mistake:

Method does not override method from its superclass

The word @Override is underlined in red, but I could not understand the error. Below is the code:

public class MainActivity extends Activity {

    @Override
    public void OnCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }
}

1 answer

10


This is a typo.

Substitute OnCreate() for onCreate(), which is the correct name of the method you are trying to overwrite.

  • 1

    Perfect Diego. Thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.