我在Android中有一個應用程序,我已經更改了主要活動,現在當我啓動它時沒有任何顯示。我不知道什麼可能是錯的。請幫忙。Android中未顯示主要活動
main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button
android:id="@+id/btnCrash"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnCrash"
/>
</LinearLayout>
的Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="gdpTesis.client" android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:name="gdpTesis.client.main.GdpTesisApplication">
<activity android:name=".main.GdpTesisMainActivity"
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>
的活動
package gdpTesis.client.main;
import gdpTesis.client.R;
import android.app.Activity;
import android.os.Bundle;
public class GdpTesisMainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
如果您使用的是Eclipse,請嘗試Project - > Clean並讓它重建。你可以啓動logcat並查看是否有任何相關的消息? – 2011-05-01 00:45:11
[主要活動未在Android中顯示]的可能的重複(http://stackoverflow.com/questions/5845411/main-activity-not-shown-in-android) – Aleadam 2011-05-01 03:44:51
請不要問兩次相同的問題:http:/ /stackoverflow.com/questions/5845411/main-activity-not-shown-in-android – Aleadam 2011-05-01 03:45:28