我試圖用這個代碼轉換活動:無法切換活動
Intent i = new Intent(this, RegisterActivity.class);
startActivity(i);
然後我得到了錯誤,說我需要將新類添加到清單,但我記得沒有改變清單做(在NetBeans現在我使用eclipse)。將類添加到清單後,我得到這個錯誤:
java.lang.RuntimeException: Unable to start activity ComponentInfo{ XXXX }: android.view.InflateException: Binary XML file line #63: Error inflating class <unknown>
任何建議來解決異常?
的清單是:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="streetMeet.Client"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity android:name=".StreetMeetActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity><activity android:name="RegisterActivity"></activity>
</application>
主要活動的佈局是:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
你能顯示你的清單和你的活動佈局嗎? – 2012-02-29 18:34:35
佈局非常基本 – Rami 2012-02-29 18:45:03
我們需要看到佈局,不管其基本原理如何。 – 2012-02-29 18:48:14