Code example for Cursor

Methods: closegetBlobgetColumnIndexOrThrowmoveToFirst

0
                            new String[] { Browser.BookmarkColumns.FAVICON },
                            Browser.BookmarkColumns.URL + " = ?",
                            new String[] { uri },
                            null); 
 
        if (!c.moveToFirst()) {
            c.close();
            return null; 
        } 
 
        int faviconIndex = c.getColumnIndexOrThrow(Browser.BookmarkColumns.FAVICON);
 
        byte[] b = c.getBlob(faviconIndex);
        c.close();
 
        if (b == null)
            return null; 
 
        Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
        return new BitmapDrawable(bitmap);
    }