RN_
RN_

Reputation: 898

Android Manifest File Error

I was following the Dev guide on google: http://developer.android.com/training/basics/firstapp/starting-activity.html

Eclipse gives me this error in my manifest file

[2012-07-13 21:59:47 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Users\Rishub\workspace\Rishubs app\AndroidManifest.xml: Attribute "name" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "activity".

Here is my manifest file

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rishubs.app"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:name=".DisplayMessageActivity"

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Thanks for all the help :)

Upvotes: 2

Views: 5272

Answers (1)

Sam
Sam

Reputation: 86958

You cannot combine two activity declarations like that. Try it like this:

<activity android:name=".MainActivity" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity android:name=".DisplayMessageActivity" />

Upvotes: 2

Related Questions