android-cursoradapter
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
Cursor adapter and sqlite example [closed]
Really simple example. Here is a really simple, but very effective, example. Once you have the basics down you can easily build off of it. There are two main parts to using a Cursor Adapter with SQLite: Create a proper Cursor from the Database. Create a custom Cursor Adapter that takes the Cursor data from … Read more