简体   繁体   English

带有AndroidManifest.xml中的NFC清单标签的Android混淆

[英]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.

相关问题 带有多个应用程序标签的AndroidManifest.xml - AndroidManifest.xml with multiple application tags 未创建Android SDK Eclipse AndroidManifest.xml - Android SDK Eclipse AndroidManifest.xml not created AndroidManifest.xml 在 Android Studio 上不可编辑 - AndroidManifest.xml not editable on Android Studio AndroidManifest.xml - 为属性&#39;manifest&#39;指定的不存在 - AndroidManifest.xml - specified for property 'manifest' does not exist android studio中的AndroidManifest.xml编码错误 - AndroidManifest.xml encodin error in android studio 清单合并失败了吗?建议:添加&#39;工具:replace =“android:appComponentFactory”&#39;来 <application> AndroidManifest.xml中的元素:8:5-34:19以覆盖 - Manifest merger failed?Suggestion:add'tools:replace=“android:appComponentFactory”'to<application>element at AndroidManifest.xml:8:5-34:19 to overide 具有默认值的Android项目的AndroidManifest.xml文件中的错误 - Error in AndroidManifest.xml File of an Android Project With Default Values AndroidManifest.xml 文件中 Android 工作室中未解决的包/类错误 - Unresolved package/class Error in Android studio in AndroidManifest.xml file AndroidManifest.xml中的“属性缺少Android名称空间前缀” - “Attribute is missing the Android namespace prefix” in AndroidManifest.xml 由于 AndroidManifest.xml,Android 热插拔不起作用 - Android hot swap not working because of AndroidManifest.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM