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
1 changed files with 40 additions and 30 deletions

View File

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