새로운 안드로이드 장치와 nfc 태그로 놀고 싶습니다. nfc 태그를 감지하는 아주 간단한 응용 프로그램을 작성했습니다. 하지만 태그를 스캔 할 때 내 활동이 시작되도록 할 수는 없었습니다.nfc 인 텐트 디스패치 문제
이간단한 활동 :
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.NfcB</tech>
<tech>android.nfc.tech.NfcF</tech>
<tech>android.nfc.tech.NfcV</tech>
<tech>android.nfc.tech.Ndef</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
<tech>android.nfc.tech.MifareClassic</tech>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
:
public class NFCIntentDispatch extends Activity{
private TextView mText;
public void onCreate(Bundle savedState) {
super.onCreate(savedState);
setContentView(R.layout.intent_dispatch);
mText = (TextView) findViewById(R.id.text);
}
}
하고
<activity android:name="NFCIntentDispatch">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
고해상도/XML에서 nfc_tech_filter.xml을 menifest.xml 여기에 내가 무엇을 가지고
문제 :
태그가 검색 될 때마다 내 장치 (Nexus S 2.3.3)는 "수집 된 새 태그"라는 활동으로 만 빌드를 시작하지만 내 활동을 선택하거나 시작하지 않습니다. 왜 이런 일이 일어나는지, 어떤 도움을 주셔서 감사합니다.
첨단 기술 목록은 열거 한 모든 형식을 지원하는 태그를 찾았다. 아래처럼 개별적으로 나열하여 첫 번째 태그 또는 다음 태그 또는 다음 태그를 찾습니다. 위는 AND 목록입니다. 응용 프로그램이 지원하는 태그를 더 잘 식별 할 수 있도록 태그 그룹을 만들 수 있습니다. –