Method does not override method from its superclass

5

I'm new to Java and I'm learning app for Android and on my route, I ran into this error:

Method does not override method from its superclass

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

public class MainActivity extends Activity {

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

    }
}
    
asked by anonymous 06.02.2016 / 17:21

1 answer

11

This is a spelling error.

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

    
06.02.2016 / 17:32