How to read NFC tag in Kivy + Python?
<p>I'm trying to read NFC tags, and if tag has just text, reading goes well. However, it doesn't work if the tag contains a URL or is empty. I believe the problem is with the nfc_filter.xml file.</p>

<pre><code>&lt;intent-filter&gt;
  &lt;action android:name="android.nfc.action.TAG_DISCOVERED"/&gt;
  &lt;action android:name="android.nfc.action.NDEF_DISCOVERED"/&gt;
  &lt;action android:name="android.nfc.action.TECH_DISCOVERED"/&gt;
  &lt;category android:name="android.intent.category.DEFAULT"/&gt;
  &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
  &lt;data android:mimeType="*/*" /&gt;
&lt;/intent-filter&gt;
</code></pre>

<p>Python code:</p>

<pre><code>def nfc_init(self):
    activity.bind(on_new_intent=self.on_new_intent)
    self.j_context = context = PythonActivity.mActivity
    self.nfc_adapter = NfcAdapter.getDefaultAdapter(context)
    self.nfc_pending_intent = PendingIntent.getActivity(context, 0, Intent(context, context.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0)
    return True

def on_new_intent(self, intent):
    print 'on_new_intent()', intent.getAction()
    # get TAG details
    tag = cast('android.nfc.Tag', intent.getParcelableExtra(NfcAdapter.EXTRA_TAG))
    details = self.get_ndef_details(tag)

def on_pause(self):
    print 'paused'
    return True

def on_resume(self):
    print 'resumed'
</code></pre>

<p>What I want is that my app would always receive the intent when it's active and you read an NFC tag. Now I can see in the log that it doesn't resume from on_pause in case the tag contains something else than text or is empty.</p>

<p>Can someone help me with this?</p>