我正在用java爲Android創建此遊戲。它的工作原理應該如此,但是當我將其導出併發送給其他人時,它會使活動找不到異常,有誰知道爲什麼?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>
護理解釋* *如何導出?你創建一個APK嗎?你在構建之前是否嘗試過清潔? – WarrenFaith
是的,我正在導出一個.apk文件,我試圖清理該項目。 – Rasmus
請添加logcat堆棧跟蹤 –