我在Google上关注开发指南:http://developer.android.com/training/basics/firstapp/starting-activity.html
Eclipse在我的清单文件中给出了这个错误
[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".
这是我的清单文件
<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>
感谢所有帮助:)
答案 0 :(得分:2)
您不能组合这样的两个活动声明。试试这样:
<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" />