开发者

retrieve thumbnail image of a browser bookmark

开发者 https://www.devze.com 2023-04-07 15:32 出处:网络
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.

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号