我正在用java为android创建这个游戏。它的工作原理应该是这样,但是当我将其导出并将其发送给其他人时,它会给出未找到异常的活动,有人知道为什么吗?
这是我的主要课程:
public class Main extends Activity implements Constants
{
private GameView mGameView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
mGameView = new GameView(this, getAssets());
setContentView(mGameView);
ActivityManager am = ((ActivityManager)getSystemService(Activity.ACTIVITY_SERVICE));
mGameView.setMemoryLimit(am.getMemoryClass());
}
}
这是清单:
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testcompany.testgame" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<application android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:theme="@style/AppTheme"
android:largeHeap="true">
<activity android:name=".Main" android:label="@string/title_activity_main"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>