Code example for SimpleCursorAdapter

Methods: setViewBinder

	class RankCursorAdapter extends SimpleCursorAdapter {
		public RankCursorAdapter(Context context, int layout, Cursor c,
				String[] from, int[] to, int flg) {
			super(context, layout, c, from, to, flg);
			setViewBinder(new RankListViewBinder());
		// 途中 
		class RankListViewBinder implements SimpleCursorAdapter.ViewBinder {
			public boolean setViewValue(View view, Cursor cursor,
					int columnIndex) {
				// 順位をセット 
				if (columnIndex == cursor
						.getColumnIndex("_id")) {
					int rank = cursor.getPosition() + 1;
					((TextView) view).setText(String.valueOf(rank));
Connect your IDE to all the code out there  Get Codota for Java