title: Why can't I see the bookmarks I have created programmaticaly when testing on my device
body: <p>I have an app which shows me all of the bookmarks. I can list the bookmarks then my button adds a bookmark. I have not implemented the code to update the list right away but when I return the new bookmark is showing in the list. 
  Its the default bookmarks I'm adding to and I add these fields</p>
  
  <pre><code> map.put(Browser.BookmarkColumns.CREATED, creationTime);
                  map.put(Browser.BookmarkColumns.TITLE, addTitle);
                  map.put(Browser.BookmarkColumns.BOOKMARK, 1);
                  cr.update(Browser.BOOKMARKS_URI, map,"_id = " + cur.getInt(0), null);
  </code></pre>
  
  <p>the new bookmark shows in the list but when I open the browser and view the bookmarks tab all of the other bookmarks are present but not any that I have created.</p>
  
  <p>I have tested this on emulators at version 7 and 10 and it works without issue but when I try it on my samsung galaxy s2 running on version 2.3.3 it adds to the list. I have stepped through on the device and the bookmark is created I know this because my code is set to add if it can't find or just rewrite if it does find. </p>
  
  <p>I have more than one browser installed I've got firefox and opera on my device. Firefox keeps its own bookmarks and I haven't used opera yet </p>
  
  <p>here's all the add bookmark code</p>
  
  <pre><code>private void addBookmark(String addTitle, String addUrl)    {
      ContentResolver cr = getContentResolver(); 
      Cursor cur = cr.query(BOOKMARKS_URI, projection,     android.provider.Browser.BookmarkColumns.BOOKMARK, null, null);
      //first find out if this title has been used before
      boolean found = false;
      long creationTime = new Date().getTime();
      if (cur.moveToFirst()) {
          String title;           
          int count = 0;
          int titleColumn;
  
          do {                 
              titleColumn = cur.getColumnIndex(BookmarkColumns.TITLE);
              title = cur.getString(titleColumn);
              if (title.equals(addTitle)) 
              {
                  found = true;
                  ContentValues map = new ContentValues();
                  map.put(Browser.BookmarkColumns.CREATED, creationTime);
                  map.put(Browser.BookmarkColumns.TITLE, addTitle);
                  map.put(Browser.BookmarkColumns.BOOKMARK, 1);
                  map.put(Browser.BookmarkColumns.DATE, 0);
                  map.put(Browser.BookmarkColumns.VISITS, 0);
                  cr.update(Browser.BOOKMARKS_URI, map,"_id = " + cur.getInt(0), null);
                  Log.d(LOGTAG,"title found: "+ Integer.toString(count));
              }
              count++;   
          }while (cur.moveToNext());
      }else {
          Log.d(LOGTAG,"didn't move to first");
      }
  
      if (!found) {
  
              cur = cr.query(BOOKMARKS_URI,
                      projection, 
                      android.provider.Browser.BookmarkColumns.BOOKMARK, 
                      null, 
                      null);
              // Adding a bookmark for a site the user has not been to.
              ContentValues map = new ContentValues();
              map.put(Browser.BookmarkColumns.TITLE, addTitle);
              map.put(Browser.BookmarkColumns.URL, addUrl);
              map.put(Browser.BookmarkColumns.CREATED, creationTime);
              map.put(Browser.BookmarkColumns.BOOKMARK, 1);
              map.put(Browser.BookmarkColumns.DATE, 0);
              map.put(Browser.BookmarkColumns.VISITS, 0);
              cr.insert(Browser.BOOKMARKS_URI, map);
      }
  }
  </code></pre>
  
  <p>this was the last code I tried
  I set the visits value to 100 and now its showing as a history item but with a star showing it as a favourite. This says to me I'm setting one of these values wrong or missing one out. The history tab knows its a favourite but the favourite tab doesn't</p>
  
  <pre><code>if (!found) {
          cur = cr.query(BOOKMARKS_URI,
                  projection,
                  android.provider.Browser.BookmarkColumns.BOOKMARK,
                  null,
                  null);
          //Adding a bookmark for a site the user has not been to.
          ContentValues map = new ContentValues();
          map.put(Browser.BookmarkColumns.TITLE, "Random title");
          map.put(Browser.BookmarkColumns.URL, "http://www.bbc.co.uk");
          map.put(Browser.BookmarkColumns.CREATED, System.currentTimeMillis());
          map.put(Browser.BookmarkColumns.BOOKMARK, 1);
          map.put(Browser.BookmarkColumns.DATE, 0L);
          map.put(Browser.BookmarkColumns.VISITS, 100);
          getContentResolver().insert(Browser.BOOKMARKS_URI, map);
  
  
      }
  </code></pre>