Reputation: 1195
I'm creating an App, that has people phone contacts and some they've made via our system. But, I've finished the login screen, but now I'm on the main class that displays all their contacts in a listview, with their latest message under each contact.
TL;DR How can I display a bunch of contacts and under each one display the latest message received.
Thanks
Upvotes: 0
Views: 222
Reputation: 4960
I'm going to try to break the answer into three sections. Have you stored the contacts information in the Contacts Content Provider?
a. This example from google shows how you can query the Contacts content provider to get a list of all the contacts details like so
b. To show the latest message received from each contact, you will need to create a custom ListView where you show the message below a contact. An example of creating a custom ListView can be found here.
c. By messages, if you are referring to SMS/text, you can access that information separately. A tutorial on how to do that can be found here.
So to summarize, you will have to combine the contacts example, the custom ListView example and the SMS example to get the result.
Upvotes: 1