Code example for CursorAdapter

0
	public static class ViewHolder { 
		TextView text1;
	} 
 
	public MainAdapter(Context context) {
		super(context, null, 0);
		mInflater = LayoutInflater.from(context);
	} 
 
	@Override 
	public void bindView(View view, Context context, Cursor cursor) {
		ViewHolder holder = (ViewHolder) view.getTag();
		String name = cursor.getString(PROJECTION_NAME);
		holder.text1.setText(name);
	} 
 
	@Override 
	public View newView(Context context, Cursor cursor, ViewGroup container) {
		ViewHolder holder = new ViewHolder();
		View view = mInflater.inflate(R.layout.main_list_item, container, false);
		holder.text1 = (TextView) view.findViewById(android.R.id.text1);