当前位置: 代码迷 >> Android >> No resource identifier found for attribute 'parentActivityName' in package 'android'
  详细解决方案

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

热度:58   发布时间:2016-04-28 02:48:38.0
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="com.example.myfirstapp.MainActivity" />    </activity></application>



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

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




  相关解决方案