title: How to simulate the tag touch from other application
body: <p>I want to simulate the touch event for my application. My manifest is like</p>
  
  <pre><code>&lt;activity
      android:name=".activity.TagActivity_"
      android:label="@string/app_name"
      android:launchMode="singleTask"
      android:noHistory="true"
      android:permission="android.permission.NFC"
      android:screenOrientation="portrait" &gt;
  
      &lt;intent-filter&gt;
          &lt;action android:name="android.nfc.action.TECH_DISCOVERED" /&gt;
      &lt;/intent-filter&gt;
      &lt;meta-data
          android:name="android.nfc.action.TECH_DISCOVERED"
          android:resource="@xml/nfc_tech_filter" /&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;data
              android:host="ext"
              android:pathPrefix="/abc:d"
              android:scheme="vnd.android.nfc" /&gt;
      &lt;/intent-filter&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;data android:mimeType="text/plain" /&gt;
      &lt;/intent-filter&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>Question (1): I want to invoke my application from other application. How do I do that? My current code is like: </p>
  
  <pre><code>try {
      final Intent intent = new Intent(NfcAdapter.ACTION_NDEF_DISCOVERED);
      NdefMessage ndefMessage = buildNdefMessage(getTagData());
      intent.putExtra(NfcAdapter.EXTRA_NDEF_MESSAGES, new NdefMessage[] {ndefMessage});
      startActivity(intent);
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>But this is not invoking my application. probably because the data type and path prefix do not match. How do I pass this while starting the activity?</p>
  
  <p>Question (2): For temp purpose I have added </p>
  
  <pre><code>&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;
  </code></pre>
  
  <p>to make it work, and my application is invoked. But while reading the tag I check the tag type, and since I am not passing any tag type, my app crashes. So how do I create a tag instance? There is no constructor for this. I mean I can't do <code>Ndef ndef = new Ndef();</code>. And I don't basically have a tag so I can't event do <code>Ndef ndef = Ndef.get(tag);</code>.</p>