1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-30 04:42:18 -05:00

Cannot add messages to adapter in a differen thread

This commit is contained in:
Sebastian Kaspari 2010-03-20 23:15:52 +01:00
parent e0793a3bfa
commit 926bd9168a

View File

@ -140,17 +140,13 @@ public class ConversationActivity extends Activity implements ServiceConnection,
}
// Fill view with messages that have been buffered while paused
new Thread() {
public void run() {
for (Conversation conversation : server.getConversations()) {
while (conversation.hasBufferedMessages()) {
if (conversation.getMessageListAdapter() != null) {
conversation.getMessageListAdapter().addMessage(conversation.pollBufferedMessage());
}
}
for (Conversation conversation : server.getConversations()) {
while (conversation.hasBufferedMessages()) {
if (conversation.getMessageListAdapter() != null) {
conversation.getMessageListAdapter().addMessage(conversation.pollBufferedMessage());
}
}
}.start();
}
}
/**