Je dois choisir mon activité lorsque le téléphone lit une étiquette. Mon application doit être visible sur le sélecteur d'activité.Impossible de lire l'étiquette nfc en mode prioritaire
Dans le fichier manifeste de mon activité, j'ai
<activity android:name=".WaitingPayment" android:noHistory="true"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="portrait" android:label="@string/app_name">
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Dans la classe d'activité j'ai:
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
try {
ndef.addDataType("*/*"); /* Handles all MIME based dispatches.
You should specify only the ones that you need. */
}
catch (MalformedMimeTypeException e) {
throw new RuntimeException("fail", e);
}
this.intentFiltersArray = new IntentFilter[] {ndef};
this.techListsArray = new String[][] { new String[] { MifareUltralight.class.getName(), Ndef.class.getName(), NfcA.class.getName()}};
Qu'est-ce que je peux faire pour voir mon tag sur l'activité chooser et le manipuler? Mon étiquette c'est un URI
grâce