i trying to make app with nfc function. the problem is when nfc tag discovered, pending intent always make a new activity that already exist. i\'m using tab host. how to mak
Put android:launchMode="singleTask" for your activity (or activities) in the manifest. That does the trick. Whenever an NFC intent is dispatched by the system, always a new Activity will be created. This is unique for NFC intents. So setting android:launchMode="singleTop" will not work, nor will setting flags in the PendingIntent.
Another solution is to use NfcAdapter.enableForegroundDispatch() in all your Activities. That way your app gets to handle all NFC intents itself directly (via onNewIntent()).