문제

I'm trying to solve the following problem, and I'm wondering if the MergeAdapter can solve it for me.

I have a ListView displaying rows of chats, 1 list item per chat subject. Within a given row I also want to display the list of users that are participating in the chat. I want a single list row to look like the following:

+--------------------------------------+
| This is a subject              Sep 2 |
| user1, user2, user3                  |
+--------------------------------------+

The list of chats is in a database table, but the list of users associated with a given chat are in a separate database table (normalized schema).

Here's a simplified schema that I'm using:

chats        chatUsers    users
-----        ---------    -----
chatId ----> chatId       name
date         userId ----> userId
subject

Would the MergeAdapter allow me to visually combine the results of the two queries into a single list item view, where:

Query 1: returns the list of chats in time order

Query 2: returns the list of users that are part of each chat

Thanks!

도움이 되었습니까?

해결책

No. MergeAdapter handles Adapter concatentation, taking adapters representing smaller queries and appending them to behave as if they were one large contiguous adapter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top