BatchButton area toggling should't happen from anything other than the

UiThread:

Fixes a common error from the market:

android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRoot.checkThread(ViewRoot.java:2802)
at android.view.ViewRoot.invalidateChild(ViewRoot.java:607)
at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:633)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:2505)
at android.view.View.invalidate(View.java:5139)
at android.view.View.setFlags(View.java:4502)
at android.view.View.setVisibility(View.java:3030)
at
com.fsck.k9.activity.MessageList.hideBatchButtons(MessageList.java:2883)
at
com.fsck.k9.activity.MessageList.toggleBatchButtons(MessageList.java:2906)
at com.fsck.k9.activity.MessageList.access$500(MessageList.java:77)
at
com.fsck.k9.activity.MessageList$MessageListAdapter.pruneDirtyMessages(MessageList.java:2302)
at com.fsck.k9.activity.MessageList$1.run(MessageList.java:811)
This commit is contained in:
Jesse Vincent 2010-11-26 03:53:10 +00:00
parent 4f08820683
commit 23254e8998
1 changed files with 49 additions and 36 deletions

View File

@ -2983,6 +2983,13 @@ public class MessageList
private void toggleBatchButtons() private void toggleBatchButtons()
{ {
runOnUiThread(new Runnable()
{
@Override
public void run()
{
if (mSelectedCount < 0) if (mSelectedCount < 0)
{ {
mSelectedCount = 0; mSelectedCount = 0;
@ -3022,6 +3029,12 @@ public class MessageList
mBatchReadButton.setImageResource(readButtonIconId); mBatchReadButton.setImageResource(readButtonIconId);
mBatchFlagButton.setImageResource(flagButtonIconId); mBatchFlagButton.setImageResource(flagButtonIconId);
}
});
} }
class FooterViewHolder class FooterViewHolder