1

I just completed my Android application which scans NFC tags. When an NFC tag comes near the device, the device tries to show all the apps which can scan the NFC tag.

I want it to remember which app it should use to scan the NFC tag. It displayed my app, but I do not want the system to always ask me which app to use.

In my two devices, it not does show any option like Use by default for this action or Always, while in my other device with Android 4.2.2, it shows the options.

Screenshot 1 Screenshot 2

Why is this so?

0

4 Answers 4

1

This is because there can be no default handler for all NFC intents. You'd have to create a mimetype for your NFC tag and use that mimetype as the data field for the intent filter.

However, this site doesn't deal with developer issues, so you'd be better off on StackExchange, for example here.

3
  • I have issue in two phones and working well in one phone.
    – user54016
    Feb 19, 2014 at 4:59
  • If I'm guessing correctly, the one device where this works has an older Android version? Those have a different way of resolving NFC intents, and that's why there can be such a checkbox. Feb 19, 2014 at 7:10
  • No, That device is new Android version 4.2.2.
    – user54016
    Feb 19, 2014 at 7:31
1

NFC disovery events that indicate only a certain tag technology (or even only the presence of any tag) are usually too broad to be bound to just one app. It seems that the Android team therefore decided that it should not be possible for one app/activity to take precedence for such an unspecific event.

As a consequence, the only way how this mandatory intent chooser can be avoided is if an NDEF formatted tag is used and if the app's developer registered the app/activity for a more specific NDEF intent (e.g. a URI, an NFC Forum external type or a MIME type).

-2

Just disable the default app for NFC by searching it in the application list. Post this your custom app will be the default app to run, when you tap NFC Tag and it will execute the task as you configured in the NFC Tag

1
  • 1
    If the "chose" dialog is shown, there obviously is no default app configured – so it cannot be disabled (also see GATrawn's comment on this answer).
    – Izzy
    Dec 20, 2014 at 14:16
-2

Someone or something has set defaults for the application(s), and this default was set as soon as someone or something set it either internally, or by hitting the button "Always."

In this case, you'll have to go to your App Drawer, go into Settings and find your Application Manager. In this case, you'll want to go to the application that doesn't have the option. Find it, click it, go down, and hit "Clear Defaults.", now, hit the home button, find the application you're wanting to run, and VOILA! The action menu should set itself back.

If it doesn't, find the application that is automatically running upon startup of that specific object, and hit Clear defaults.

2
  • This is not my case, dialog box show the list of all the apps which can scan the NFC tag but issue is that "“Use by default for this action” or “Always” not displaying. If any app is already set as default then above screenshot was not asking the apps to scan the NFC tag. Above screenshot showing two apps which scan scan the NFC
    – user54016
    Feb 18, 2014 at 9:09
  • 2
    @TheFxApoc the screenshots show that no default has been set (otherwise you wouldn't see that dialog at all)
    – GAThrawn
    Feb 18, 2014 at 11:13

You must log in to answer this question.