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 9167031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:17:31+00:00 2026-06-17T15:17:31+00:00

I have a question about the android NFC. I have already done the function

  • 0

I have a question about the android NFC.

I have already done the function about read and write, but still have one problem.

I wrote the AAR in my tag, after first sensing, it can launch my application.

Second time sensing (my application is launched), I can read the data from NFC tag.

Is it possible just sensing once that can launch my application and get the data from 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-06-17T15:17:32+00:00Added an answer on June 17, 2026 at 3:17 pm

    In AndroidManifest –

      <activity
            android:name=".TagDiscoverer"
            android:alwaysRetainTaskState="true"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:screenOrientation="nosensor" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <action android:name="android.nfc.action.TECH_DISCOVERED" />
                <action android:name="android.nfc.action.TAG_DISCOVERED" />
    
                <category android:name="android.intent.category.DEFAULT" />
    
                <data android:mimeType="text/plain" />
            </intent-filter>
    
            <meta-data
                android:name="android.nfc.action.TECH_DISCOVERED"/>
        </activity>
    

    you should initiate the NFC adopter in OnCreate()..

         /**
          * Initiates the NFC adapter
         */
      private void initNfcAdapter() {
        nfcAdapter = NfcAdapter.getDefaultAdapter(this);
        mPendingIntent = PendingIntent.getActivity(this, 0,
            new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
       }
    

    Now in OnResume() …

      @Override
      protected void onResume() {
      super.onResume();
      if (nfcAdapter != null) {
        nfcAdapter.enableForegroundDispatch(this, mPendingIntent, null, null);
      }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read many questions about Android, J2ME and RecordStore , but I still
I read http://developer.android.com/reference/android/app/Activity.html but I have a question about PreferenceActivity lifecycle: Does a PreferenceActivity
I have one question about Android. I need to run one of my activities
I have a question about Sql database in android.Now Ive done the all Notepad
i have a question about pictures in an ImageView in Android. My problem is,
I have reads many question about this, but I still failed using this code...
I have a question about Android Market/Google Play license model for paid applications. First
I have a comprehension question about Android Services. I have a Service that performs
I have a question about making a drawing app for Android. What is the
Possible Duplicate: Detect multitouch with Ontouch listener Android I have a question about detecting

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.