Code example for SimpleCursorAdapter

Methods: setViewBinder

	private static final int SHORT_DESC_NUM_WORDS = 12;
	public BoothDescriptionProductListAdapter(Context context, int layout, Cursor c, 
			String[] from, int[] to, int flags) {
		super(context, layout, c, from, to, flags);
	public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
		// we only make a difference in the description text, where we want to just 
		// take the first 12 words and show them 
		if (view.getId() == {
			TextView shortDescView = (TextView) view;
			String text = cursor.getString(columnIndex);
			String[] textArray = text.split(" ");
Experience pair programming with AI  Get Codota for Java