Rami
Rami

Reputation: 2148

Unable to switch activity

I tried to switch activities with this code:

     Intent i = new Intent(this, RegisterActivity.class);  
     startActivity(i);

then I got error which said that I need to add the new class to the manifest, although I remember doing it without changing the manifest(in netbeans now I'm using eclipse). After adding the class to the manifest I got this error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{ XXXX }: android.view.InflateException: Binary XML file line #63: Error inflating class <unknown>

Any suggestions to solve the exception?

the manifest is:

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

the layout of the main activity is:

<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" />

Upvotes: 0

Views: 188

Answers (2)

Rami
Rami

Reputation: 2148

As you guys pointed out my problem was at XML Layout. And it didn't matter whether i add a "." or not.

Thanks

Upvotes: 1

Squonk
Squonk

Reputation: 48871

You forgot the preceding . for your Activity name in your manifest. It should be...

android:name=".RegisterActivity"

Upvotes: 2

Related Questions