0
다음 코드에 따라 기본 브라우저에서 키워드를 검색 할 수 있습니다.Android, Chrome 브라우저에서 검색된 키워드를 가져 오는 방법 (Uri 검색)?
List<SearchRecord> searchList = new LinkedList<SearchRecord>();
ContentResolver resolver = this.getContentResolver();
Cursor cursor = resolver.query(Browser.SEARCHES_URI, Browser.SEARCHES_PROJECTION, null, null, null);
cursor.moveToFirst();
if (cursor.moveToFirst() && cursor.getCount() > 0) {
while (cursor.isAfterLast() == false) {
SearchRecord record = new SearchRecord();
record.setKeyword(cursor.getString(Browser.SEARCHES_PROJECTION_SEARCH_INDEX));
record.setDate(cursor.getLong(Browser.SEARCHES_PROJECTION_DATE_INDEX));
searchList.add(record);
cursor.moveToNext();
}
}
다음 코드는 북마크
Uri uriCustom = Uri.parse("content://com.android.chrome.browser/bookmarks");
내가 검색 키워드를 얻기 위해 크롬의 열린 우리당을 찾고의 목록을 반환합니다. 그게 뭔지 알아? 감사합니다
난이 도움이 http://stackoverflow.com/a/16609205/942224에게 –
감사 Sanket 될 것입니다 생각, 내가 전에 그 답을보고 있지만 내 질문에 관련이없는 것. 그것은 기본 브라우저의 북마크를 반환합니다. Chrome 브라우저의 검색 키워드를 찾고 있습니다. – Hesam
잘 모르겠지만 거기에서도 검색 기록을 얻을 수 있습니다. –