Android 使用<;数据>;清单中的元素?
我有一个nexus-s,我有一个nfc标签,上面写着以下数据:Android 使用<;数据>;清单中的元素?,android,Android,我有一个nexus-s,我有一个nfc标签,上面写着以下数据: http://www.example.com/abc 当nexus-s发现标记时,我会得到两个可以处理标记读取的应用程序的列表: tags (included with the nexus-s I think) MyTagReadingApp (my own demo app) 这是我的演示应用程序的清单: <activity android:name=".activities.ActivityReadTag"
http://www.example.com/abc
当nexus-s发现标记时,我会得到两个可以处理标记读取的应用程序的列表:
tags (included with the nexus-s I think)
MyTagReadingApp (my own demo app)
这是我的演示应用程序的清单:
<activity
android:name=".activities.ActivityReadTag"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
因此,我尝试将清单更新为:
<activity
android:name=".activities.ActivityReadTag"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action
android:name="android.nfc.action.NDEF_DISCOVERED" />
但还是没有运气。我正在使用api 10(2.3.3)。尝试添加
action android:name=“android.intent.action.VIEW”否则,您的应用程序将不会显示在appchooser中
过滤器的其余部分在我看来还行奇怪,它在我的nexus S上运行良好。 也许这就是你的意图
dat=http://example.com/foo/1234 flg=0x10000000 (has extras)
但是,您的应用程序将只响应WWW.example.com。我用example.com创建了一个标签,应用程序不再响应
<activity
android:name=".activities.ActivityReadTag"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action
android:name="android.nfc.action.NDEF_DISCOVERED" />
dat=http://example.com/foo/1234 flg=0x10000000 (has extras)