我正在创建一个NFC应用程序,我的第一个目标是从mifare标签获取标签uid.当我按下标签按钮时,我的活动进入第二个活动,我应该获得tagID.
我收到资源查找错误.我知道我正在做一些重大错误但却找不到.
请你帮忙.
这是我的Meanifest文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chetan.nfc"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10"></uses-sdk>
<uses-feature android:required="true" android:name="android.hardware.nfc"></uses-feature>
<uses-permission android:name="android.permission.NFC"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:enabled="true">
<activity android:name=".actOne"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="taginfo" android:label="@string/app_name" android:launchMode="standard">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data android:resource="@xml/nfc_tech_filter" android:name="@string/nfc_tech_filter"></meta-data>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
这是我的活动之一:
package com.chetan.nfc;
import java.util.Date;
import android.app.Activity;
import android.app.LauncherActivity;
import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.NfcAdapter;
import android.nfc.tech.NdefFormatable;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import …Run Code Online (Sandbox Code Playgroud)