AndroidManifest.xml - 找不到属性' launchmode'的资源标识符。在包' android'

时间:2017-11-21 21:09:02

标签: android nfc

触发NFC时,我尝试使用单个活动实例。添加android:launchmode =" singleTask"应该做的伎俩,但我配置启动模式时出错:

  

属性android:这里不允许启动模式

的AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="packageName"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.NFC" />

    <uses-feature
        android:name="android.hardware.nfc"
        android:required="false" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true" >

        <activity
            android:name=".NFCReader"
            android:label="@string/app_name"
            android:launchmode="singleTask" >

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

            <meta-data
                android:name="android.nfc.action.TECH_DISCOVERED"
                android:resource="@xml/nfc_tech_filter" />
        </activity>
    </application>

</manifest>

1 个答案:

答案 0 :(得分:1)

android:launchMode而非android:launchmode