Code example for Tag

Methods: getId, getTechList

0
		} 
		try{// Check if Intent has a NFC Tag. 
		if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) {
			Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
			mTag = tag;
			mUID = tag.getId();
 
			// Return "1" if device supports Mifare Classic. "0" otherwise. 
			return (Arrays.asList(tag.getTechList()).contains(MifareClassic.class.getName())) ? 1 : 0;
		} 
		}catch(Exception e){
			return -1; 
		} 
		return -1; 
	} 
 
	/** 
	 * Create a connected {@link MCReader} if there is a present Mifare Classic tag. If there is no Mifare Classic tag a error message will be 
	 * displayed to toe user. 
	 *  
	 * @param context The Context in which the error Toast will be shown.