Android onChange event not called in contentObserver for Chrome history on Android 5 (Lollipop)

I noticed that my contentObservers for history and Chrome bookmarks no longer fire on Android Lolipop. The code works fine on older Android versions (regardless of Chrome version), but it doesn't work anymore on Lollipop.

I've filed a bug on chrome and others confirm it in the comments. https://code.google.com/p/chromium/issues/detail?q=obogzch%40gmail.com&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&id=435541&thanks= 435541 & TS = 1416575883

Has anyone found a solution to this problem?

LE: Thanks to Fuong Lee for the workaround, call this method after adding the content browser to start it:

private boolean checkContentProvider(Uri uri) //uri = content://com.android.chrome.browser/history

   {
        Cursor mCur = getContentResolver().query(uri, null, null, null, null);
        return (mCur.getCount() > 0);
   }

      

+3


source to share


1 answer


When I change the new URI for chrome bookmarks from "content: //com.android.chrome.browser/bookmarks" to the new URI "content: //com.android.chrome.browser/history" the same goes for "onChange event does not fire on Lolipop version ". And, I try the request data to check if the watcher is registered ... it works like magic. I don't know why it works correctly, I hope it helps.



+2


source







All Articles