Code example for NdefMessage

0
                return; 
            } 
 
            nfcAdapter.setNdefPushMessage(new NdefMessage(
                    new NdefRecord[]{
                            new NdefRecord(NdefRecord.TNF_MIME_MEDIA,
                                    ScheduleContract.Sessions.CONTENT_ITEM_TYPE.getBytes(), 
                                    new byte[0], 
                                    sessionUri.toString().getBytes())
                    }), activity);
        } 
    } 
 
    /** 
     * Checks to see if the activity's intent ({@link android.app.Activity#getIntent()}) is 
     * an NFC intent that the app recognizes. If it is, then parse the NFC message and set the 
     * activity's intent (using {@link Activity#setIntent(android.content.Intent)}) to something 
     * the app can recognize (i.e. a normal {@link Intent#ACTION_VIEW} intent). 
     */ 
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    public static void tryUpdateIntentFromBeam(Activity activity) {