我试图用这个代码转换活动:无法切换活动
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