title: Get browser history and search result in android
body: <p>I am trying to get the history and search results from the android browser.
  In the following code I get all the bookmarks, which works great:</p>
  
  <pre><code>public void getBrowser(){
      String[] requestedColumns = {
          Browser.BookmarkColumns.TITLE,
          Browser.BookmarkColumns.VISITS,
          Browser.BookmarkColumns.BOOKMARK
      };
      Cursor faves = managedQuery(Browser.BOOKMARKS_URI, requestedColumns,
      Browser.BookmarkColumns.BOOKMARK + "=1", null, Browser.BookmarkColumns.VISITS);
      Log.d(DEBUG_TAG, "Bookmarks count: " + faves.getCount());
      int titleIdx = faves.getColumnIndex(Browser.BookmarkColumns.TITLE);
      int visitsIdx = faves.getColumnIndex(Browser.BookmarkColumns.VISITS);
      int bmIdx = faves.getColumnIndex(Browser.BookmarkColumns.BOOKMARK);
      faves.moveToFirst();
      while (!faves.isAfterLast()) {
          Log.d("SimpleBookmarks", faves.getString(titleIdx) + " visited " + faves.getInt(visitsIdx) + " times : " + (faves.getInt(bmIdx) != 0 ? "true" : "false"));
          faves.moveToNext();
      }
  }
  </code></pre>
  
  <p>When I am trying to only get the history from the browser I am trying following code:</p>
  
  <pre><code>public void getBrowserHist()  {
      Cursor mCur = managedQuery(Browser.BOOKMARKS_URI, Browser.HISTORY_PROJECTION, null, null, null);
      mCur.moveToFirst();
      if (mCur.moveToFirst() &amp;&amp; mCur.getCount() &gt; 0) {
          while (mCur.isAfterLast() == false) {
              Log.v("titleIdx", mCur.getString(Browser.HISTORY_PROJECTION_TITLE_INDEX));
              Log.v("urlIdx", mCur.getString(Browser.HISTORY_PROJECTION_URL_INDEX));
              mCur.moveToNext();
          }
      }
  }
  </code></pre>
  
  <p>The problem is that I now get all the bookmarks, history and top visited pages. And I only want the history columns. I also wan´t the search results from google search. I have tried the SEARCHES_URI object but I can´t get it to work.
  Does anyone have any suggestion hove I can solve my problem?</p>