retrieve thumbnail image of a browser bookmark
I am creating my own android app widget to display browser bookmarks. & i n开发者_StackOverflow社区eed 2 show the thumbnail image of the bookmarks in my widget.
However the Browser.BookmarkColumns
doesnt expose the "thumbnail" data.
any idea on how to get the thumbnail image ?
thanx in advance
It does expose the fav icon of the website. But its available in the database if that bookmark url was successfully visited at least once. Also when accessing the internal Android databases use the managedQuery()
method.
Here is a snippet for accessing the fav icon from db.
Cursor mCur = managedQuery(android.provider.Browser.BOOKMARKS_URI,
projection, null, null, null);
mCur.moveToFirst();
int titleIdx = mCur.getColumnIndex(Browser.BookmarkColumns.TITLE);
int urlIdx = mCur.getColumnIndex(Browser.BookmarkColumns.URL);
int urlIdx = mCur.getColumnIndex(Browser.BookmarkColumns.FAVICON);
精彩评论