Code example for Cursor

Methods: getStringmoveToPosition

0
 
    cursor = getContentResolver().query(Browser.BOOKMARKS_URI, BOOKMARK_PROJECTION,
        BOOKMARK_SELECTION, null, null);
    if (cursor == null) {
      Log.w(TAG, "No cursor returned for bookmark query");
      finish();
    } else { 
      startManagingCursor(cursor);
      setListAdapter(new BookmarkAdapter(this, cursor));
    } 
  } 
 
  @Override 
  protected void onListItemClick(ListView l, View view, int position, long id) {
    if (!cursor.isClosed() && cursor.moveToPosition(position)) {
      Intent intent = new Intent();
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
      intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN));
      intent.putExtra(Browser.BookmarkColumns.URL, cursor.getString(URL_COLUMN));
      setResult(RESULT_OK, intent);
Stop searching for code, let great code find you!  Add Codota to your java IDE