Android NFC TECH_DISCOVERED with foreground dispatcher
<p>I am programming an NFC application in Android and I have a little problem when writing tags. I have been able to write a tag but in order to do it I detect it using intent-filters in the manifest. However, what I want to do is to deal with the tag directly with the application using the foreground dispatcher. I am able to "catch" NDEF_DISCOVERED tags with the foreground dispatcher but I don't know how to use TECH_DISCOVERED in the same fashion.</p>

<p>This code works with NDEF_DISCOVERED:</p>

<pre><code>    // Setup an intent filter for all MIME based dispatches
    IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
    try {
        ndef.addDataType("*/*");
   } catch (MalformedMimeTypeException e) {
        throw new RuntimeException("fail", e);
    }
   mFilters = new IntentFilter[] {
            ndef,
    };

    // Setup a tech list for all NfcF tags
    mTechLists = new String[][] { new String[] { NfcF.class.getName() } };
</code></pre>

<p>But what should I do for TECH_DISCOVERED???? I'm trying this and it doesn't work:</p>

<pre><code>    IntentFilter ntech = new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED);


   mFilters = new IntentFilter[] {
            ntech,
    };

    // Setup a tech list for all NfcF tags
    mTechLists = new String[][] { new String[] { NfcF.class.getName() } };
}
</code></pre>
