[英]Android-Confusion with NFC Manifest Tags in AndroidManifest.xml
I want to open my MainActivity automatically as soon as I show the tag near by my Android Tablet. 我想在Android平板电脑附近显示标签后自动自动打开MainActivity。 My Manifest file is shown below.
我的清单文件如下所示。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nfc"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="16" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.nfc.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/com.example.nfc"/>
</intent-filter>
</activity>
<activity android:name=".NewConnection">
</activity>
</application>
</manifest>
But My MainActivity does not be opened when I show the tag . 但是,当显示标签时,不会打开My MainActivity。
And I need Another help that I have a button in MainActivity when I click that button NewConnection Activity must be opened.In NewConnection Activity I need to write some content in Edittext.After I entered the contents if I show the tag the content must be written in the tag . 我需要另一个帮助,当我单击该按钮时必须在MainActivity中有一个按钮才能打开NewConnection活动。在NewConnection活动中,我需要在Edittext中编写一些内容。输入内容后(如果显示标记)必须编写内容在标签中。
for that ,what I need to give insted of question marks i given 为此,我需要给我一些问号
<activity android:name=".MainActivity">
.
.
.
<intent-filter>
????????
???????
</intent-filter>
</activity>
<activity android:name=".NewConnection">
.
.
.
<intent-filter>
????????
???????
</intent-filter>
</activity>
please help me friends . 请帮助我的朋友们。
Take a look here, this post explains how an Intent can be dispatched to your activity upon the system recognizing a new tag. 在这里看看,这篇文章解释了系统识别新标签后如何将Intent分配给您的活动。
How to discover any NFC tech (not only tags) using Android? 如何使用Android发现任何NFC技术(不仅是标签)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.