Best practices to query SQLite database in ListFragment with CursorLoader?

Sorry no experience in CursorLoader yet and Fragment, but I already experienced use of SQLiteOpenHelper in the context of concurrent access by different threads & activities. I will assume that PlayersDBAdapter is internally using a SQLiteOpenHelper class. but it is not clear what your methods open() and close() are doing? What I did: define your … Read more

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

tech