Cursor getString - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Cursor getString method.

This code example shows how to use the following methods:getString, moveToPosition
    setListAdapter(new BookmarkAdapter(this, cursor));
  } 
 
  @Override 
  protected void onListItemClick(ListView l, View view, int position, long id) {
    if (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);
    } else { 
      setResult(RESULT_CANCELED);
    } 
    finish();
  } 
} 
9
CodeRank
This code example shows how to use the following methods:getInt, getString
        mContactAccessor = ContactAccessor.getInstance();
    } 
 
    @Override 
    public final CharSequence convertToString(Cursor cursor) {
        String name = cursor.getString(RecipientsAdapter.NAME_INDEX);
        int type = cursor.getInt(RecipientsAdapter.TYPE_INDEX);
        String number = cursor.getString(RecipientsAdapter.NUMBER_INDEX).trim();
 
        String label = cursor.getString(RecipientsAdapter.LABEL_INDEX);
        CharSequence displayLabel = mContactAccessor.phoneTypeToString(mContext, type, label);
 
        if (number.length() == 0) {
            return number;
        } 
 
        if (name == null) {
            name = "";
        } else { 
            // Names with commas are the bane of the recipient editor's existence. 

9
CodeRank
This code example shows how to use the following methods:close, getColumnIndexOrThrow, getLong, getString, moveToFirst
8
CodeRank
This code example shows how to use the following methods:getColumnIndexOrThrow, getString, isAfterLast, moveToPosition
                args, R.string.user_dict_settings_add_dialog_title, null, null, 0);
    } 
 
    private String getWord(final int position) {
        if (null == mCursor) return null;
        mCursor.moveToPosition(position);
        // Handle a possible race-condition 
        if (mCursor.isAfterLast()) return null;
 
        return mCursor.getString(
                mCursor.getColumnIndexOrThrow(UserDictionary.Words.WORD));
    } 
 
    private String getShortcut(final int position) {
        if (null == mCursor) return null;
        mCursor.moveToPosition(position);
        // Handle a possible race-condition 
        if (mCursor.isAfterLast()) return null;
 
        return mCursor.getString(

8
CodeRank
This code example shows how to use the following methods:getInt, getLong, getString, isNull
 
    /** @inheritdoc */ 
    @Override 
    public SpecialNamesEntity readEntity(Cursor cursor, int offset) {
        SpecialNamesEntity entity = new SpecialNamesEntity( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // count
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // select
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // sum
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // avg
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // join
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // distinct
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // on
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // index
            cursor.isNull(offset + 9) ? null : cursor.getInt(offset + 9) // order
        ); 
        return entity;
    } 
      
    /** @inheritdoc */ 
8
CodeRank
This code example shows how to use the following methods:close, getString, moveToFirst
    } 
 
    private static String getCalendarId(Uri uri, ContentResolver cr) {
        Cursor calendar = cr.query(uri, new String[] { CALENDAR_ID_COLUMN }, null, null, null);
        try { 
            calendar.moveToFirst();
            return calendar.getString(0);
        } catch (CursorIndexOutOfBoundsException e) {
            return null; 
        } finally  { 
            calendar.close();
        } 
    } 
 
    @SuppressWarnings("nls") 
    public static boolean deleteTaskEvent(Task task) {
        boolean eventDeleted = false;
        String uri;
        if(task.containsNonNullValue(Task.CALENDAR_URI))
            uri = task.getValue(Task.CALENDAR_URI);
8
CodeRank
This code example shows how to use the following methods:getColumnIndex, getInt, getLong, getString, isNull
        final boolean validIcon = mResPackage != null && mIconRes != -1;
        return validIcon ? pm.getDrawable(mResPackage, mIconRes, null) : null;
    } 
 
    private static String getString(Cursor cursor, String columnName) {
        return cursor.getString(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName) {
        return cursor.getInt(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName, int missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getInt(columnIndex);
    } 
 
    private static long getLong(Cursor cursor, String columnName, long missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getLong(columnIndex);

8
CodeRank
This code example shows how to use the following methods:getLong, getString
        loadFromCursor(c);
        mDiffDataValues = new ContentValues();
    } 
 
    private void loadFromCursor(Cursor c) {
        mDataId = c.getLong(DATA_ID_COLUMN);
        mDataMimeType = c.getString(DATA_MIME_TYPE_COLUMN);
        mDataContent = c.getString(DATA_CONTENT_COLUMN);
        mDataContentData1 = c.getLong(DATA_CONTENT_DATA_1_COLUMN);
        mDataContentData3 = c.getString(DATA_CONTENT_DATA_3_COLUMN);
    } 
 
    public void setContent(JSONObject js) throws JSONException {
        long dataId = js.has(DataColumns.ID) ? js.getLong(DataColumns.ID) : INVALID_ID;
        if (mIsCreate || mDataId != dataId) {
            mDiffDataValues.put(DataColumns.ID, dataId);
        } 
        mDataId = dataId;
 
        String dataMimeType = js.has(DataColumns.MIME_TYPE) ? js.getString(DataColumns.MIME_TYPE)
8
CodeRank
This code example shows how to use the following methods:close, getCount, getString, moveToFirst
	             	new String[]{MediaStore.Images.Media.DATA}, // Which columns to return 
	             	MediaStore.Images.Media._ID+ "=?",       // Which rows to return 
	             	new String[]{String.valueOf(id)},       // Selection arguments
	             	null);// order 
		 
		if(cursor!=null && cursor.getCount()>0)
		{ 
			cursor.moveToFirst();
			String filepath = cursor.getString(0);
			cursor.close();
			int rotation = 0;
			 
			try 
			{ 
				ExifInterface exifInterface = new ExifInterface(filepath);
				int exifRotation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,ExifInterface.ORIENTATION_UNDEFINED);
 
				if(exifRotation!=ExifInterface.ORIENTATION_UNDEFINED)
				{ 
					switch(exifRotation)
8
CodeRank
This code example shows how to use the following methods:getCount, getLong, getString, isAfterLast, isLast
        addJulie(); 
 
        assertThat(updateName("Belvedere")).isEqualTo(2); 
 
        Cursor cursor = database.query("table_name", new String[]{"id", "name"}, null, null, null, null, null);
        assertThat(cursor.moveToFirst()).isTrue();
        assertThat(cursor.getCount()).isEqualTo(2);
 
        assertIdAndName(cursor, 1234L, "Belvedere");
        assertThat(cursor.moveToNext()).isTrue();
 
        assertIdAndName(cursor, 1235L, "Belvedere");
        assertThat(cursor.isLast()).isTrue();
        assertThat(cursor.moveToNext()).isFalse();
        assertThat(cursor.isAfterLast()).isTrue();
        assertThat(cursor.moveToNext()).isFalse();
    } 
 
    @Test 
    public void testDelete() throws Exception { 

8
CodeRank
This code example shows how to use the following methods:close, getBlob, getInt, getString, moveToFirst
 
        Cursor cur = mDB.rawQuery("SELECT "
                + join(Consumers.PACKAGE_NAME, Consumers.IS_SERVICE_PUBLIC, 
                        Consumers.OWNS_CONSUMER_KEY, Consumers.REGISTRY_ID, Consumers.SIGNATURE) 
                + " FROM consumers", null); 
        assertTrue(cur.moveToFirst());
        assertEquals(PACKAGE_UNDER_TEST, cur.getString(0));
        assertEquals(0, cur.getInt(1));
        assertEquals(1, cur.getInt(2));
        assertEquals(1, cur.getInt(3));
        assertEquals(new Signature(SIGNATURE_FOR_PACKAGE), new Signature(cur.getBlob(4)));
        cur.close();
    } 
 
    public void testShouldUpdateCorrectly() throws Exception { 
        setPackage(PACKAGE_UNDER_TEST);
        setSignature(SIGNATURE_FOR_PACKAGE);
 
        ContentValues value = new ContentValues();
        value.put(Registry.ACCESS_TOKEN_URL, "http://access");
8
CodeRank
This code example shows how to use the following methods:close, getLong, getString, moveToFirst
		Cursor cursor = contentResolver.query(contactUri,
				new String[] {
						Contacts._ID, Contacts.DISPLAY_NAME
				}, null, null, null); 
		try { 
			if (cursor.moveToFirst()) {
				contactId = cursor.getLong(0);
				contactInfo.setDisplayName(cursor.getString(1));
			} 
		} finally { 
			cursor.close();
		} 
 
		// Load the phone number (if any). 
		cursor = contentResolver.query(Phone.CONTENT_URI,
				new String[] {
					Phone.NUMBER
				}, 
				Phone.CONTACT_ID + "=" + contactId, null,
				Phone.IS_SUPER_PRIMARY + " DESC");
8
CodeRank
This code example shows how to use the following methods:getBlob, getDouble, getFloat, getInt, getLong
 
    /** @inheritdoc */ 
    @Override 
    public SimpleEntity readEntity(Cursor cursor, int offset) {
        SimpleEntity entity = new SimpleEntity( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getShort(offset + 1) != 0, // simpleBoolean
            cursor.isNull(offset + 2) ? null : (byte) cursor.getShort(offset + 2), // simpleByte
            cursor.isNull(offset + 3) ? null : cursor.getShort(offset + 3), // simpleShort
            cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // simpleInt
            cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // simpleLong
            cursor.isNull(offset + 6) ? null : cursor.getFloat(offset + 6), // simpleFloat
            cursor.isNull(offset + 7) ? null : cursor.getDouble(offset + 7), // simpleDouble
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // simpleString
            cursor.isNull(offset + 9) ? null : cursor.getBlob(offset + 9) // simpleByteArray
        ); 
        return entity;
    } 
      
    /** @inheritdoc */ 
8
CodeRank
This code example shows how to use the following methods:close, getColumnIndex, getCount, getString, moveToFirst
                return new File(uri.getPath());
            case URI_TYPE_CONTENT: {
                Cursor cursor = contentResolver.query(uri, LOCAL_FILE_PROJECTION, null, null, null);
                if (cursor != null) {
                    try { 
                        int columnIndex = cursor.getColumnIndex(LOCAL_FILE_PROJECTION[0]);
                        if (columnIndex != -1 && cursor.getCount() > 0) {
                            cursor.moveToFirst();
                            String realPath = cursor.getString(columnIndex);
                            if (realPath != null) {
                                return new File(realPath);
                            } 
                        } 
                    } finally { 
                        cursor.close();
                    } 
                } 
            } 
        } 
        return null; 
7
CodeRank
This code example shows how to use the following methods:getColumnIndexOrThrow, getCount, getString, moveToFirst
                        null,       // WHERE clause selection arguments (none) 
                        null); 		// Order-by clause (ascending by name) 
         
        if(cursor!=null)
        { 
        	int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        	if(  cursor.getCount()>0 && cursor.moveToFirst() )
            { 
            	imagePath = cursor.getString(column_index);
            } 
        } 
         
        return imagePath;
    } 
	 
	/** 
	 * 获取图片缩略图 
	 * 只有Android2.1以上版本支持 
	 * @param imgName 
	 * @param kind   MediaStore.Images.Thumbnails.MICRO_KIND 
7
CodeRank
This code example shows how to use the following methods:getColumnIndex, getInt, getLong, getString, isNull
        final boolean validIcon = mResPackage != null && mIconRes != -1;
        return validIcon ? pm.getDrawable(mResPackage, mIconRes, null) : null;
    } 
 
    private static String getString(Cursor cursor, String columnName) {
        return cursor.getString(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName) {
        return cursor.getInt(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName, int missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getInt(columnIndex);
    } 
 
    private static long getLong(Cursor cursor, String columnName, long missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getLong(columnIndex);

8
CodeRank
This code example shows how to use the following methods:close, getInt, getLong, getString, moveToFirst
 
        // Load the display name for the specified person 
        Cursor cursor = contentResolver.query(contactUri,
                new String[]{Contacts._ID, Contacts.DISPLAY_NAME, Contacts.PHOTO_ID}, null, null, null);
        try { 
            if (cursor.moveToFirst()) {
                contactId = cursor.getLong(0);
                contactInfo.setDisplayName(cursor.getString(1));
                contactInfo.setPhotoId(cursor.getInt(2));
            } 
        } finally { 
            cursor.close();
        } 
 
        boolean modified=false;
        cursor = contentResolver.query(Phone.CONTENT_URI,
        		new String[]{Phone.NUMBER},
                Phone.TYPE + "=" + Phone.TYPE_MOBILE+" and "+Phone.CONTACT_ID + "=" + contactId, null, null);
        try { 
        	 if (cursor.moveToNext()){
8
CodeRank
This code example shows how to use the following methods:getString, moveToPosition
    setListAdapter(new BookmarkAdapter(this, cursor));
  } 
 
  @Override 
  protected void onListItemClick(ListView l, View view, int position, long id) {
    if (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);
    } else { 
      setResult(RESULT_CANCELED);
    } 
    finish();
  } 
} 
8
CodeRank
This code example shows how to use the following methods:close, getColumnIndex, getString, moveToFirst
	} 
 
	public void deleteScene(long id) throws IOException {
		Cursor cursor = getScene(id);
		String path = getString(cursor, SceneColumn.SCENE_DIRECTORY);
		cursor.close();
		if (new File(path).exists()) {
			Runtime.getRuntime().exec("rm -r " + path);
		} 
		db.delete(TABLE_SCENES, sceneIdClause(id), null);
	} 
	 
	public void deleteRecording(long id) throws IOException {
		Cursor cursor = getRecording(id);
		String path = getString(cursor, RecordingColumn.RECORDING_PATH);
		cursor.close();
		if (new File(path).exists()) {
			Runtime.getRuntime().exec("rm " + path);
		} 
		db.delete(TABLE_RECORDINGS, recordingIdClause(id), null);

7
CodeRank
This code example shows how to use the following methods:close, getString, moveToFirst
	 
	public static String lookupSingleStringValue(SQLiteDatabase db, String columnName, String table, String selection, String[] selectionArgs, String defaultValue) {
		String retval = defaultValue;
		Cursor c = db.query(table, new String[]{columnName}, selection, selectionArgs, null, null, null);
		try { 
			if(c.moveToFirst()){
				retval = c.getString(0);
			} 
		} finally { 
			c.close();
		} 
		return retval;
	} 
	 
	public static void executeAssetSQL(SQLiteDatabase db, Resources resources, String assetPath){
		db.beginTransaction();
		try { 
			String createSQL = StringUtils.loadAssetString(resources, assetPath);
			 
			for(String sql : createSQL.split("\\?")){
8
CodeRank
This code example shows how to use the following methods:close, getColumnIndexOrThrow, getString, moveToFirst
					String[] projection = { MediaStore.Images.Media.DATA };
					 
					Cursor cursor = managedQuery(selectedImageUri, projection, null, null, null);
					 
					if(cursor != null) {
						int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
						 
						cursor.moveToFirst();
						 
						String path = cursor.getString(column_index);
						 
						cursor.close();
						 
						BitmapFactory.Options bfo = new BitmapFactory.Options();
						bfo.inDither = true;
						bfo.inSampleSize = 2;
						 
						Bitmap bm = BitmapFactory.decodeFile(path, bfo);
						 
						if (bm != null) {
7
CodeRank
This code example shows how to use the following methods:copyStringToBuffer, getLong, getString
 
        @Override 
        public void bindView(View view, Context context, Cursor cursor) {
            final ContactListItemCache cache = (ContactListItemCache) view.getTag();
            // Set the name 
            cursor.copyStringToBuffer(SUMMARY_NAME_COLUMN_INDEX, cache.nameBuffer);
            int size = cache.nameBuffer.sizeCopied;
            cache.nameView.setText(cache.nameBuffer.data, 0, size);
            final long contactId = cursor.getLong(SUMMARY_ID_COLUMN_INDEX);
            final String lookupKey = cursor.getString(SUMMARY_LOOKUP_KEY);
            cache.photoView.assignContactUri(Contacts.getLookupUri(contactId, lookupKey));
        } 
 
        @Override 
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            View view = super.newView(context, cursor, parent);
            ContactListItemCache cache = new ContactListItemCache();
            cache.nameView = (TextView) view.findViewById(R.id.name);
            cache.photoView = (QuickContactBadge) view.findViewById(R.id.badge);
            view.setTag(cache);
7
CodeRank
This code example shows how to use the following methods:close, getColumnIndex, getString, moveToFirst
    public static String getPathFromUri(ContentResolver resolver, Uri contentUri) {
        final String dataColumn = MediaStore.MediaColumns.DATA;
        Cursor cursor = null;
        try { 
            cursor = resolver.query(contentUri, new String[] { dataColumn }, null, null, null);
            if (cursor == null || !cursor.moveToFirst())
                return null; 
            final int index = cursor.getColumnIndex(dataColumn);
            return cursor.getString(index);
        } finally { 
            if (cursor != null)
                cursor.close();
        } 
    } 
} 
7
CodeRank
This code example shows how to use the following methods:getBlob, getInt, getLong, getString

7
CodeRank
This code example shows how to use the following methods:getColumnIndexOrThrow, getString, moveToFirst
	 
	public static String getPath(Activity activity, Uri uri) {
	    String[] projection = { MediaStore.Images.Media.DATA };
	    Cursor cursor = activity.managedQuery(uri, projection, null, null, null);
	    activity.startManagingCursor(cursor);
	    int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
	    cursor.moveToFirst();
	    return cursor.getString(column_index);
	} 
	 
	public static int getExifOrientation(String filepath) {
		int degree = 0;
		ExifInterface exif = null;
		try { 
			exif = new ExifInterface(filepath);
		} catch (IOException ex) {
			ex.printStackTrace();
		} 
		if (exif != null) {
			int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);
7
CodeRank
This code example shows how to use the following methods:close, getString, moveToNext
 
    public static String getString(Context context, String name, String defaultValue) {
        SQLiteDatabase db = new SuperuserDatabaseHelper(context).getReadableDatabase();
        Cursor cursor = db.query("settings", new String[] { "value" }, "key='" + name + "'", null, null, null, null);
        try { 
            if (cursor.moveToNext())
                return cursor.getString(0);
        } 
        finally { 
            cursor.close();
            db.close();
        } 
        return defaultValue;
    } 
 
    public static void setInt(Context context, String name, int value) {
        setString(context, name, ((Integer) value).toString());
    } 
 
    public static int getInt(Context context, String name, int defaultValue) {
7
CodeRank
This code example shows how to use the following methods:getLong, getString
		public String title = "";
		public String note = "";
		public String duedate = "";
 
		public Note(final Cursor c) {
			id = c.getLong(0);
			title = c.getString(1);
			note = c.getString(2);
			duedate = c.getString(3);
		} 
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:close, getColumnIndex, getCount, getString, moveToFirst
	} 
	 
	public Bundle getUser(long id) throws SQLException {
		Cursor cursor = db.query(true, USER_TABLE, new String[] {KEY_USERNAME, KEY_PASSWORD}, KEY_COREIDREFERENCE + "=" + id, null, null, null, null, null);
		Bundle b = null;
		if (cursor != null && cursor.getCount() > 0) {
			b = new Bundle();
			cursor.moveToFirst();
			b.putString(KEY_USERNAME, cursor.getString(cursor.getColumnIndex(KEY_USERNAME)));
			b.putString(KEY_PASSWORD, cursor.getString(cursor.getColumnIndex(KEY_PASSWORD)));
			cursor.close(); 
		} 
		return b;
	} 
	 
	public void deleteUser(long coreId) {
		db.delete(USER_TABLE, KEY_COREIDREFERENCE + "=" + coreId, null);
	} 
 
	public void cleanupEvents(Integer[] bufferids) {
8
CodeRank
This code example shows how to use the following methods:close, getCount, getString, moveToFirst, setNotificationUri
 
        SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
        qb.setTables(args.table);
 
        Cursor ret = qb.query(db, select, args.where, args.args, null, null, sort);
        ret.setNotificationUri(getContext().getContentResolver(), url);
        return ret;
    } 
 
    @Override 
    public String getType(Uri url) {
        // If SqlArguments supplies a where clause, then it must be an item 
        // (because we aren't supplying our own where clause). 
        SqlArguments args = new SqlArguments(url, null, null);
        if (TextUtils.isEmpty(args.where)) {
            return "vnd.android.cursor.dir/" + args.table;
        } else { 
            return "vnd.android.cursor.item/" + args.table;
        } 
    } 

7
CodeRank
This code example shows how to use the following methods:close, getColumnIndexOrThrow, getString, moveToFirst
		Cursor c = db.query(TABLE_PUBKEYS, new String[] { "_id",
				FIELD_PUBKEY_NICKNAME }, "_id = ?",
				new String[] { Long.toString(id) }, null, null, null);
 
		if (c != null) {
			if (c.moveToFirst())
				nickname = c.getString(c.getColumnIndexOrThrow(FIELD_PUBKEY_NICKNAME));
 
			c.close();
		} 
 
		db.close();
 
		return nickname;
	} 
 
/* 
	public void setOnStart(long id, boolean onStart) { 
 
		SQLiteDatabase db = this.getWritableDatabase(); 
7
CodeRank

Related Cursor getString Questions & Answers:

Other Cursor getString Examples

93:				do {
94:					WebSite site = new WebSite();
95:					site.setId(Integer.parseInt(cursor.getString(0)));
96:					site.setTitle(cursor.getString(1));
97:					site.setLink(cursor.getString(2));
-
94:					WebSite site = new WebSite();
95:					site.setId(Integer.parseInt(cursor.getString(0)));
96:					site.setTitle(cursor.getString(1));
97:					site.setLink(cursor.getString(2));
98:					site.setRSSLink(cursor.getString(3));
-
95:					site.setId(Integer.parseInt(cursor.getString(0)));
96:					site.setTitle(cursor.getString(1));
97:					site.setLink(cursor.getString(2));
98:					site.setRSSLink(cursor.getString(3));
99:					site.setDescription(cursor.getString(4));
-
96:					site.setTitle(cursor.getString(1));
97:					site.setLink(cursor.getString(2));
98:					site.setRSSLink(cursor.getString(3));
99:					site.setDescription(cursor.getString(4));
100:					// Adding contact to list
-
97:					site.setLink(cursor.getString(2));
98:					site.setRSSLink(cursor.getString(3));
99:					site.setDescription(cursor.getString(4));
100:					// Adding contact to list
101:					siteList.add(site);
-
141:				cursor.moveToFirst();
142:	
143:			WebSite site = new WebSite(cursor.getString(1), cursor.getString(2),
144:					cursor.getString(3), cursor.getString(4));
145:	
-
141:				cursor.moveToFirst();
142:	
143:			WebSite site = new WebSite(cursor.getString(1), cursor.getString(2),
144:					cursor.getString(3), cursor.getString(4));
145:	
-
142:	
143:			WebSite site = new WebSite(cursor.getString(1), cursor.getString(2),
144:					cursor.getString(3), cursor.getString(4));
145:	
146:			site.setId(Integer.parseInt(cursor.getString(0)));
-
142:	
143:			WebSite site = new WebSite(cursor.getString(1), cursor.getString(2),
144:					cursor.getString(3), cursor.getString(4));
145:	
146:			site.setId(Integer.parseInt(cursor.getString(0)));
-
144:					cursor.getString(3), cursor.getString(4));
145:	
146:			site.setId(Integer.parseInt(cursor.getString(0)));
147:			site.setTitle(cursor.getString(1));
148:			site.setLink(cursor.getString(2));
-
145:	
146:			site.setId(Integer.parseInt(cursor.getString(0)));
147:			site.setTitle(cursor.getString(1));
148:			site.setLink(cursor.getString(2));
149:			site.setRSSLink(cursor.getString(3));
-
146:			site.setId(Integer.parseInt(cursor.getString(0)));
147:			site.setTitle(cursor.getString(1));
148:			site.setLink(cursor.getString(2));
149:			site.setRSSLink(cursor.getString(3));
150:			site.setDescription(cursor.getString(4));
-
147:			site.setTitle(cursor.getString(1));
148:			site.setLink(cursor.getString(2));
149:			site.setRSSLink(cursor.getString(3));
150:			site.setDescription(cursor.getString(4));
151:			cursor.close();
-
148:			site.setLink(cursor.getString(2));
149:			site.setRSSLink(cursor.getString(3));
150:			site.setDescription(cursor.getString(4));
151:			cursor.close();
152:			db.close();

Read More

76:				cursor.moveToFirst();
77:	
78:			Contact contact = new Contact(Integer.parseInt(cursor.getString(0)),
79:					cursor.getString(1), cursor.getString(2));
80:			// return contact
-
77:	
78:			Contact contact = new Contact(Integer.parseInt(cursor.getString(0)),
79:					cursor.getString(1), cursor.getString(2));
80:			// return contact
81:			return contact;
-
77:	
78:			Contact contact = new Contact(Integer.parseInt(cursor.getString(0)),
79:					cursor.getString(1), cursor.getString(2));
80:			// return contact
81:			return contact;
-
95:				do {
96:					Contact contact = new Contact();
97:					contact.setID(Integer.parseInt(cursor.getString(0)));
98:					contact.setName(cursor.getString(1));
99:					contact.setPhoneNumber(cursor.getString(2));
-
96:					Contact contact = new Contact();
97:					contact.setID(Integer.parseInt(cursor.getString(0)));
98:					contact.setName(cursor.getString(1));
99:					contact.setPhoneNumber(cursor.getString(2));
100:					// Adding contact to list
-
97:					contact.setID(Integer.parseInt(cursor.getString(0)));
98:					contact.setName(cursor.getString(1));
99:					contact.setPhoneNumber(cursor.getString(2));
100:					// Adding contact to list
101:					contactList.add(contact);

Read More

11:				do {
12:					Contact contact = new Contact();
13:					contact.setID(Integer.parseInt(cursor.getString(0)));
14:					contact.setName(cursor.getString(1));
15:					contact.setPhoneNumber(cursor.getString(2));
-
12:					Contact contact = new Contact();
13:					contact.setID(Integer.parseInt(cursor.getString(0)));
14:					contact.setName(cursor.getString(1));
15:					contact.setPhoneNumber(cursor.getString(2));
16:					// Adding contact to list
-
13:					contact.setID(Integer.parseInt(cursor.getString(0)));
14:					contact.setName(cursor.getString(1));
15:					contact.setPhoneNumber(cursor.getString(2));
16:					// Adding contact to list
17:					contactList.add(contact);

Read More

getString Method Overview
Returns the value of the requested column as a String.
See Code Examples for other Android Cursor Methods: