Code example for NdefRecord

0
        byte[] data = new byte[1 + langBytes.length + textBytes.length];
        data[0] = (byte) status;
        System.arraycopy(langBytes, 0, data, 1, langBytes.length);
        System.arraycopy(textBytes, 0, data, 1 + langBytes.length, textBytes.length);
 
        return new NdefRecord(NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_TEXT, new byte[0], data);
    } 
 
    private Tag getTag(final Intent intent) {
        if(intent == null || !intent.hasExtra(NfcAdapter.EXTRA_TAG)) return null;
 
        Parcelable tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
        if(tag == null) return null;
        return (Tag) tag;
    } 
 
    private void toastMessage(Object ob) {
        String msg = "";
        if(ob == null || !(ob instanceof String)) {
            msg = "-- Attempt to toast msg failed --";
Contextual code suggestions in your IDE  Get Codota for Java