1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 10:22:15 -05:00

Update issue 2479

possible fix for "The content of the adapter has changed but ListView did not receive a notification."
This commit is contained in:
Marcus Wolschon 2011-01-18 15:34:41 +00:00
parent 951dbcbd33
commit 60ea4c6ce7

View File

@ -341,8 +341,9 @@ public class ChooseFolder extends K9ListActivity
} }
}); });
mAdapter.setNotifyOnChange(false); mAdapter.setNotifyOnChange(false);
mAdapter.clear();
int selectedFolder = -1; int selectedFolder = -1;
try {
mAdapter.clear();
int position = 0; int position = 0;
for (String name : localFolders) for (String name : localFolders)
{ {
@ -375,6 +376,15 @@ public class ChooseFolder extends K9ListActivity
} }
position++; position++;
} }
} finally {
mAdapter.setNotifyOnChange(true);
runOnUiThread(new Runnable() {
public void run() {
// runOnUiThread(
mAdapter.notifyDataSetChanged();
}
});
}
mHandler.dataChanged(); mHandler.dataChanged();