如何从API 23中的浏览器获取当前URL。我尝试使用Browser.BookmarkColumns,但它已从API 23中删除。提前感谢
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;
}
在API 23中,它不会返回任何网址,但在API23下方会返回浏览网址。请帮我。过去一天,我对此感到震惊