首页 > 代码库 > No resource identifier found for attribute 'parentActivityName' in package 'android'

No resource identifier found for attribute 'parentActivityName' in package 'android'

AndroidManifest.xml中代码如下:

<pre name="code" class="java"><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.myfirstapp.DisplayMessageActivity"
        android:label="@string/title_activity_display_message" 
        android:parentActivityName="com.example.myfirstapp.MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=http://www.mamicode.com/"com.example.myfirstapp.MainActivity" />>


导入项目后就出现这个error:No resource identifier found for attribute ‘parentActivityName‘ in package ‘android‘

查了很久才知道android:parentActivityName 是 Android 4.1 (API level 16)中才有的. 所以把sdk改成16或以上的版本就可以了。




No resource identifier found for attribute 'parentActivityName' in package 'android'