Code example for NdefRecord

        PackageManager pm = context.getPackageManager();
        List<ResolveInfo> activities = pm.queryIntentActivities(intent, 0);
        if (activities.isEmpty()) {
            return null; 
        ResolveInfo info = activities.get(0);
        ((ImageView) root.findViewById(;
        ((TextView) root.findViewById(;
        root.setTag(new ImageRecordEditInfo());
        return root;
    public static ImageRecord parse(NdefRecord record) {
        MimeRecord underlyingRecord = MimeRecord.parse(record);
        // Try to ensure it's a legal, valid image 
        byte[] content = underlyingRecord.getContent();
Experience pair programming with AI  Get Codota for Java