mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Be more careful about deleting messages from the MessageListAdapter -
don't do it from something that's not the UI thread
This commit is contained in:
parent
4aba667a4e
commit
602099cfd3
@ -2288,20 +2288,23 @@ public class MessageList
|
||||
}
|
||||
public void pruneDirtyMessages()
|
||||
{
|
||||
Iterator<MessageInfoHolder> iter = mAdapter.messages.iterator();
|
||||
while (iter.hasNext())
|
||||
synchronized (mAdapter.messages)
|
||||
{
|
||||
MessageInfoHolder holder = iter.next();
|
||||
if (holder.dirty)
|
||||
Iterator<MessageInfoHolder> iter = mAdapter.messages.iterator();
|
||||
while (iter.hasNext())
|
||||
{
|
||||
if (holder.selected)
|
||||
MessageInfoHolder holder = iter.next();
|
||||
if (holder.dirty)
|
||||
{
|
||||
mSelectedCount--;
|
||||
toggleBatchButtons();
|
||||
if (holder.selected)
|
||||
{
|
||||
mSelectedCount--;
|
||||
toggleBatchButtons();
|
||||
}
|
||||
mAdapter.removeMessage(holder);
|
||||
}
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeMessages(List<MessageInfoHolder> holders)
|
||||
|
Loading…
Reference in New Issue
Block a user