我想製作自己的應用程序,而我只是非常想啓動它。但由於某種原因,我不能讓它在我的模擬器上工作。我沒有錯誤消息,所以我不知道什麼是錯的:S對不起,我在編程中一個novic,我找不到任何幫助我的東西。謝謝 !Android應用程序無法啓動,可能是Android清單
這裏是我的代碼:
xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/BBG"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Big Bang Theory" />
<Button
android:id="@+id/HIMYM"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="How I Met Your Mother" />
</LinearLayout>
Android清單:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.watchserie"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Menu"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
菜單的Java文件:
package watchserie.niels;
import com.example.watchserie.R;
import android.app.Activity;
import android.os.Bundle;
public class Menu extends Activity {
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
}
}
你是什麼意思「我不能讓它工作。」?它在做什麼或不做什麼? – BlackHatSamurai
檢查佈局xml文件的名稱,以及您傳遞給setContentView的id的名稱 – DGomez