Reputation: 1
I am new to Android apps development. I have a question on switching two activities. I followed a youtube for switching two activities: http://www.youtube.com/watch?v=0wz0bM-xy3M
But when I enter those code as shown in the bottom for my next class NextActivity.java
,
I noticed that I have three mistakes.......
protected void onCreate(Bundle savedInstanceState)
- The method onCreate(Bundle)
of type NextActivity
must override or implement a supertype methodsuper.onCreate(savedInstanceState)
-The method onCreate()
in the type Application is not applicable for the arguments (Bundle)setContentView(R.layout.next)
- The method setContentView(int)
is undefined for the type NextActivityWhat's mistakes do I make? Thanks a lot!
package gorilla3d.activitytutorial;
import android.app.Application;
import android.os.Bundle;
public class NextActivity extends Application {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.next);
}
}
Upvotes: 0
Views: 61
Reputation: 5872
You need to extend Activity instead of Application
...
public class NextActivity extends Activity {
...
Upvotes: 2