title: NFC reading Android Java - null object from getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)
body: <p>I'm trying to realize a simple Android application to read from an NFC tag.
  I followed the official documentation (<a href="https://developer.android.com/guide/topics/connectivity/nfc" rel="nofollow noreferrer">https://developer.android.com/guide/topics/connectivity/nfc</a>) to actually realize an application that is almost equal to the one created by &quot;codexpedia&quot; -&gt; <a href="https://github.com/codexpedia/android_nfc_read_write" rel="nofollow noreferrer">Source code</a>.</p>
  <p>When a tag is near the smartphone the onNewIntent method is call, but, when I try to get data through the method <code>getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)</code>, I always obtain null.</p>
  <p>You can find the code that is causing the problem at the following direct link <a href="https://github.com/codexpedia/android_nfc_read_write/blob/master/app/src/main/java/com/example/peng/nfcreadwrite/MainActivity.java" rel="nofollow noreferrer">link</a></p>
  <p>Is there anyone that knows why it happens?</p>