如何从crome浏览器中获取仅保存的书签页面并在Android应用程序中显示?

时间:2017-03-31 11:45:17

标签: android

  final String[] columns = { Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.URL };
    Cursor query = getContentResolver().query(Browser.BOOKMARKS_URI,columns, null, null, null);
    query.moveToFirst();
    while (query.moveToNext()) {
    String title = query.getString(query.getColumnIndex(Browser.BookmarkColumns.TITLE));
    String url = query.getString(query.getColumnIndex(Browser.BookmarkColumns.URL));
    Log.d("msg"," d  "+title+"  d "+url);
    urlArray.add(url);
    }

final String[] columns = { Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.URL };
Cursor query = getContentResolver().query(Browser.BOOKMARKS_URI,columns, null, null, null);
query.moveToFirst();
while (query.moveToNext()) {
String title = query.getString(query.getColumnIndex(Browser.BookmarkColumns.TITLE));
String url = query.getString(query.getColumnIndex(Browser.BookmarkColumns.URL));
Log.d("msg"," d  "+title+"  d "+url);
urlArray.add(url);
}

我已经使用了这段代码,但是这段代码给了我浏览器历史记录,我想只得到书签页面网址。

0 个答案:

没有答案