Reputation: 1
when i adding fragment into second activity android studio warn me "'onCreate(Bundle)' is already defined in 'com.example.midexam.MainActivity2'"
how to solve it, can i change it?
Upvotes: 0
Views: 31
Reputation: 76
You can only have one onCreate method inside an activity. Just remove the first onCreate and change setContentView to the correct layout.
Upvotes: 1