Code example for CursorAdapter

Methods: notifyDataSetChanged

0
	public void setSelectedPosition(int position, ListView l) {
		if (mSelectedPosition != position) {
			// View view = (View) l.getItemAtPosition(position); 
			Log.e(TAG, String.format("Current position: %d. New position: %d",
					mSelectedPosition, position));
			notifyDataSetChanged();
			mSelectedPosition = position;
 
		} 
 
	} 
 
	@Override 
	public void bindView(View view, Context context, Cursor cursor) {
		TextView list_item = (TextView) view.findViewById(android.R.id.text1);
		//FROM_COLLECTIONS = { COLLECTION_ID, COLLECTION_NAME, COLLECTION_DESC}; 
		list_item.setText( /*
							 * cursor.getString(cursor.getColumnIndex( 
							 * WB_INDICATOR_ID))+ "-" + 
							 */cursor.getString(cursor
				.getColumnIndex(COLLECTION_NAME)));