我得到的错误:-
04-08 00:37:48.540: E/AndroidRuntime(528): java.lang.RuntimeException:
Unable to instantiate activity ComponentInfo{com.android.collision/
com.android.collision.GameViewActivity}: java.lang.InstantiationException:
can't instantiate class com.android.collision.GameViewActivity; no empty constructor
编码部分的其他细节,我必须通过 SurfaceView 扩展我的主要活动类
我的清单 xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.collision"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".GameViewActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我的邮件活动是:-
public class GameViewActivity extends SurfaceView {
/** Called when the activity is first created. */
public GameViewActivity(Context context) {
super(context);
}