我在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