Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6228549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:24:35+00:00 2026-05-24T09:24:35+00:00

I’m developing an Android application to catch NFC tag information. The device I use

  • 0

I’m developing an Android application to catch NFC tag information. The device I use is a Google Nexus S.

When i searched this subject, I found lots of information about getting my application in the “Complete action using” dialog. This is working fine now, when I read a RFID tag, I’m able to select my application and I parse the INTENT.

A couple NFC apps from NXP show op in the “Complete action using” dialog too but when one of this applications is active (foreground) I can read tags WITHOUT GETTING QUESTIONED AGAIN what app to open.

My question: How can I PREVENT the “Complete action using” dialog when my app is already running like NXP does?

Note: My application is already set to single instance mode.

Here is a snippet of my code:

package nfc.test;

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter.MalformedMimeTypeException;
import android.nfc.*;
import android.nfc.tech.*;
import android.os.Bundle;

public class NfcActivity extends Activity {

    private NfcAdapter mAdapter;
    private PendingIntent mPendingIntent;
    private IntentFilter[] mFilters;
    private String[][] mTechLists;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        

        mAdapter = NfcAdapter.getDefaultAdapter(this);
        mPendingIntent = PendingIntent.getActivity(
                this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);

        IntentFilter techFilter = new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED);
        IntentFilter tagFilter = new IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED);
        IntentFilter ndefFilter = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);

        try {
            techFilter.addDataType("*/*");      // Handles all MIME based dispatches. 
            tagFilter.addDataType("*/*");       // You should specify only the ones that you need.
            ndefFilter.addDataType("*/*");
        } catch (MalformedMimeTypeException e) {
            DialogHelper.showErrorDialog(this, "MalformedMimeTypeException" + e.getMessage());
        }

        mFilters = new IntentFilter[] {
                techFilter,
                tagFilter,
                ndefFilter
        };

        mTechLists = new String[][] { new String[] { 
                IsoDep.class.getName(),             // ISO 14443-4
                MifareClassic.class.getName(),      // Mifare Classic
                MifareUltralight.class.getName(),   // Mifare Ultra Light
                Ndef.class.getName(),               // NFC Forum Type 1, 2, 3, 4 Compliant Tags         
                NdefFormatable.class.getName(),     // Can be used as NDEF tag
                NfcA.class.getName(),               // ISO 14443-3A
                NfcB.class.getName(),               // ISO 14443-3B
                NfcF.class.getName(),               // JIS 6319-4
                NfcV.class.getName()                // ISO 15693
        } };
    }

    @Override
    public void onPause() {
        super.onPause();
        mAdapter.disableForegroundDispatch(this);
    }

    @Override
    public void onResume() {
        super.onResume();
        mAdapter.enableForegroundDispatch(this, mPendingIntent, mFilters, mTechLists);
    }

    @Override
    public void onNewIntent(Intent intent) {        
        super.setIntent(intent);
        resolveIntent(intent);
    }

    public void resolveIntent(Intent intent) {

        if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())
                 || NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())
                 || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) {

            Tag tag = (Tag)intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);

            // Handle tag
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:24:36+00:00Added an answer on May 24, 2026 at 9:24 am

    How can I PREVENT the “Complete action using” dialog when my app is already running like NXP does?

    Use enableForegroundDispatch() to indicate the tag events that you handle. Here is a sample project demonstrating this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.