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

Android Cursor with ORMLite to use in CursorAdapter

ORMLite now supports next(), previous(), moveRelative(offset), … methods on the CloseableIterator class. This should allow you to move the underlying Cursor object around at will. It also supports the following DAO Cursor methods: dao.mapSelectStarRow(databaseResults) Return the latest row from the database results from a query to select *. With this you can change the cursor … Read more