Code example for SimpleCursorAdapter

Methods: setViewBinder

0
	} 
 
	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);
			setTitle("Ranking");
			setViewBinder(new RankListViewBinder());
		} 
 
		// 途中 
		class RankListViewBinder implements SimpleCursorAdapter.ViewBinder {
			@Override 
			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));
					((TextView) view).setTypeface(mFace);