Reputation: 17
I have a sqlite database which contains multiple messages.
Each message has a
I want to display them to the screen in a scrollable list. Each list item can be clicked on which will then start another activity to edit the message.
I don't want direct code on how to do it, I'd prefer suggestions on how to do it so I can learn myself. If I need to give any extra info please ask.
Upvotes: 0
Views: 24
Reputation: 6126
You need to use adapter in your case CursorAdapter
would be appropriate. There are many tutorials on internet about CursorAdapter
and using it alongside with SQLite
:
http://www.vogella.com/tutorials/AndroidSQLite/article.html https://coderwall.com/p/fmavhg/android-cursoradapter-with-custom-layout-and-how-to-use-it
A general note about Adapters is that they are a mean to transfer your data to appropriate View so you can populate your ListView
, GridView
, ... with the customized data. But this need a whole tutorial. You can also look to see how to work with different type of views which allow to be populated with Adapters.
Upvotes: 1