cursoradapter with different row layouts
So I finally got it work. For the ones interested the working code is below: private int getItemViewType(Cursor cursor) { String type = cursor.getString(cursor.getColumnIndex(“type”)); if (type.equals(“1”)) { return 0; } else { return 1; } } @Override public int getItemViewType(int position) { Cursor cursor = (Cursor) getItem(position); return getItemViewType(cursor); } @Override public int getViewTypeCount() { … Read more