title: not getting to onNewIntent after tapping to another NFC enabled device.(android)
body: <p>The main problem is that we are unable to go to onNewIntent() when i tap my phone with other NFC enabled phone(NFC is ON).
  Under no circumstances other than the main intent, i am unable to reach onNewIntent. I have tried all the three filters NDEF,TECH, TAG.</p>
  
  <pre><code>package com.example.nfctry;
  
  import android.nfc.NfcAdapter;
  import android.nfc.Tag;
  import android.os.Bundle;
  import android.app.Activity;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.view.Menu;
  import android.widget.Toast;
  
  public class MainActivity extends Activity {
  NfcAdapter adapter;
  PendingIntent pendingIntent;
  IntentFilter writeTagFilters[];
  boolean writeMode;
  Tag myTag;
  Context ctx;
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      ctx = this;
  
      adapter = NfcAdapter.getDefaultAdapter(this);
      pendingIntent = PendingIntent.getActivity(this,0,new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0);
      IntentFilter tagDetected = new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED);
      tagDetected.addCategory(Intent.CATEGORY_DEFAULT);
      writeTagFilters = new IntentFilter[] {tagDetected};
  
      onNewIntent(getIntent());
  
  
  
  }
  
  @Override
  protected void onNewIntent(Intent intent)
  {
      Toast.makeText(this,""+intent.getAction(), Toast.LENGTH_LONG).show();
      super.onNewIntent(intent);
      // getIntent() should always return the most recent
      if(NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))
      {
          myTag= intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
          Toast.makeText(this,"DETECTED muahhhhh"  + myTag.toString(), Toast.LENGTH_LONG).show();
  
      }
  
  
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  }
  </code></pre>
  
  <p>and in android mainfest i have added the intentfilters as well.</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.nfctry"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="15"
      android:targetSdkVersion="17" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.nfctry.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
          &lt;action android:name="android.nfc.action.NDEF_DISCOVERED" /&gt;
  
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.nfc.action.TECH_DISCOVERED" /&gt;
  
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.nfc.action.TAG_DISCOVERED" /&gt;
  
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
  
          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
          &lt;meta-data
          android:name="android.nfc.action.TECH_DISCOVERED"
          android:resource="@xml/nfc_tech_filter" /&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>