Cannot query for chrome’s bookmarks when it is close

In my android app, the user supposes to search for bookmarks in chrome browser.
But I found once I turn off the browser, the query will get a “null” cursor.(Works fine when chrome running in the background)
Here is my code:(query for all bookmarks)

resultCursor = context.getContentResolver().query(Browser.BOOKMARKS_URI, new String[] {Browser.BookmarkColumns.TITLE,Browser.BookmarkColumns.URL}, null, null, sortOrder);

There is no permission warning in the Log.

I tried to replace the content provider uri to "content://com.android.chrome.browser/bookmarks" and get the same problem.
I wonder if there is something wrong in the query code, or it is just a bug at chrome side.
Thanks.


Source: bookmarks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.