List of usage examples for android.database.sqlite SQLiteCursor getColumnIndexOrThrow
@Override public int getColumnIndexOrThrow(String columnName)
From source file:com.gmail.taneza.ronald.carbs.myfoods.MyFoodsEditableFragment.java
private FoodItem getFoodItemAtPosition(ListView l, int position) { SQLiteCursor cursor = (SQLiteCursor) l.getItemAtPosition(position); return new FoodItem(cursor.getString(cursor.getColumnIndexOrThrow(FoodDbAdapter.COLUMN_TABLE_NAME)), cursor.getInt(cursor.getColumnIndexOrThrow(FoodDbAdapter.MYFOODS_COLUMN_ID)), cursor.getInt(cursor.getColumnIndexOrThrow(FoodDbAdapter.MYFOODS_COLUMN_QUANTITY_PER_UNIT))); }