title: Reading the tag UID of Mifare classic card
body: <p>I am creating an app for NFC where my first objective is to get the tag uid from the mifare tag.
  When i press the tag button my activvity goes to second activity where i should be getting the tagID.</p>
  
  <p>I am getting error of resource lookup. I know i am doing some major mistakes but could not find it.</p>
  
  <p>Request you to please help.</p>
  
  <p>This is my Meanifest file</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.chetan.nfc"
    android:versionCode="1"
    android:versionName="1.0"&gt;
  &lt;uses-sdk android:minSdkVersion="10"&gt;&lt;/uses-sdk&gt;
  &lt;uses-feature android:required="true" android:name="android.hardware.nfc"&gt;&lt;/uses-feature&gt;
  &lt;uses-permission android:name="android.permission.NFC"&gt;&lt;/uses-permission&gt;
  
  
  &lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:enabled="true"&gt;
      &lt;activity android:name=".actOne"
                android:label="@string/app_name"&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;/activity&gt;
      &lt;activity android:name="taginfo" android:label="@string/app_name" android:launchMode="standard"&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;meta-data android:resource="@xml/nfc_tech_filter" android:name="@string/nfc_tech_filter"&gt;&lt;/meta-data&gt;
  
      &lt;/activity&gt;
  
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>This is my activity one:</strong></p>
  
  <pre><code>package com.chetan.nfc;
  
  import java.util.Date;
  
  import android.app.Activity;
  import android.app.LauncherActivity;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.nfc.NfcAdapter;
  import android.nfc.tech.NdefFormatable;
  import android.os.Bundle;
  import android.os.Parcelable;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.TextView;
  
  public class actOne extends Activity {
  /** Called when the activity is first created. */
  
  Button tag;
  Intent i;
  TextView tv;
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      tag=(Button)findViewById(R.id.Tag);
      tv=(TextView)findViewById(R.id.textView1);
  
      tag.setOnClickListener(new Button.OnClickListener()
      {
          public void onClick(View v)
          {
              i=new Intent(v.getContext(),taginfo.class);
              startActivity(i);
  
  
          //launchActivity();
          }
      });
  
  }
  }
  </code></pre>
  
  <p><strong>This is my Activity 2</strong></p>
  
  <pre><code>package com.chetan.nfc;
  
  import java.io.IOException;
  
  import android.app.Activity;
  import android.app.PendingIntent;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.content.IntentFilter.MalformedMimeTypeException;
  import android.nfc.NfcAdapter;
  import android.nfc.Tag;
  import android.nfc.tech.MifareClassic;
  import android.os.Bundle;
  import android.os.Parcelable;
  import android.util.Log;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class taginfo extends Activity{
  TextView tv;
  EditText tagIntent;
  Log log;
  IntentFilter mFilters[];
  String mTechLists[][];
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedState) {
  super.onCreate(savedState);
  setContentView(R.layout.tagdata);
  tagIntent=(EditText)findViewById(R.id.editText1);
  tv=(TextView)findViewById(R.id.textView1);
  tv.setText(getIntent().toString());
  
  log.e("before get intetn", "");
  
  readTag(getIntent());
  }
  
  public void readTag(Intent intent)
  {
      //tagIntent.setText(intent.getAction());
  
      PendingIntent mPendingIntent = PendingIntent.getActivity(this, 0,
              new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
  
      NfcAdapter nfc_adapter=NfcAdapter.getDefaultAdapter(this);
  IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED);
  
  Tag myTag = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
      byte[] tagId = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID);
      tagIntent.setText("");
      tagIntent.setText(tagId.toString());      
  }
  }
  </code></pre>