I'm trying to develop an android app that could delete android's built in browser bookmark. Here is my code
ContentResolver cr = getContentResolver();
try
{
Cursor c = cr.query(
Browser.BOOKMARKS_URI,
new String [] { Browser.BookmarkColumns._ID,
Browser.BookmarkColumns.BOOKMARK,
Browser.BookmarkColumns.VISITS },
"bookmark != 0",
null,
null);
c.moveToFirst();
cr.delete(Browser.BOOKMARKS_URI, null, null);
}
catch (IllegalStateException e)
{
e.printStackTrace();
}
The problem with the above code is that it is able to delete the bookmark perfectly fine. It deletes Bookmark but it will also deletes the Browser History as well which it's not supposed to. Please help me to clear this riddle, Thanks in advance.