问题
how to get current URL from Browser in API 23. I tried to use Browser.BookmarkColumns, but it was removed from API 23. thanks in advance
public String chromeHistory(){
String[] proj = new String[]{"title","url"};
Uri uriCustom = Uri.parse("content://com.android.chrome.browser/bookmarks");
String sel = "bookmark = 0";
Cursor mCur = getContentResolver().query(uriCustom, proj, sel, null, "date"+" ASC");
String url = "";
if (mCur.moveToFirst()){
do{
url = mCur.getString(mCur.getColumnIndex("url"));
}while(mCur.moveToNext());
}
mCur.close();
return url;
}
In API 23 it does not return any url, but below API23 it returns browsing url. Please help me. I was struck in this for past one day
来源:https://stackoverflow.com/questions/33213081/how-to-get-current-url-from-browser-in-api-23