如何从扩展SurfaceView的另一个类开始扩展SurfaceView的类

时间:2018-06-27 10:24:44

标签: java android surfaceview

我正试图在Android Studio中解决这个问题,但我找不到找到开始第二堂课的方法。

public FrontViewPanel(Context context) {
    super(context);
    this.mContext = context;
}

line 41     Intent intent = new Intent(mContext, GamePanel.class);
line 42     mContext.startActivity(intent);

不起作用:

06-27 12:20:05.023 16332-16332/samuel.kaufmann.myapplication E/InputEventReceiver: Exception dispatching input event.
06-27 12:20:05.023 16332-16332/samuel.kaufmann.myapplication E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
06-27 12:20:05.062 16332-16332/samuel.kaufmann.myapplication E/MessageQueue-JNI: android.content.ActivityNotFoundException: Unable to find explicit activity class {samuel.kaufmann.myapplication/samuel.kaufmann.myapplication.GamePanel}; have you declared this activity in your AndroidManifest.xml?
                                                                                     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1637)
                                                                                     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1434)
                                                                                     at android.app.Activity.startActivityForResult(Activity.java:3434)
                                                                                     at android.app.Activity.startActivityForResult(Activity.java:3395)
                                                                                     at android.app.Activity.startActivity(Activity.java:3630)
                                                                                     at android.app.Activity.startActivity(Activity.java:3598)
                                                                                     at samuel.kaufmann.myapplication.FrontViewPanel.onTouchEvent(**FrontViewPanel.java:42**)

还有另一个命令来启动GamePanel类吗?

0 个答案:

没有答案