I have a chatting application that saves the messages in a Sqlite database. I need to load all messages for each chat when clicked by user and show them in ListView in an activity. So i was wondering how to do this ?
I thought of a couple of ways to do that
First option: get the data from database (messages i.e. Strings) before opening the messaging screen for the user in arrays and pass them through the intent when starting the messaging activity and then show the messages on onCreate() method.
Second Option: get the data (messages i.e. Strings) from database when activity is being created and show them.
Third option: Saving Persistent State according to Sqlite
Any other ideas are appreciated. Thanks.