Because the addition of a header view is synchronous, but view removal is done in View.post(), there can be a case when two adds happen in a row, and it can lead to a crash. Performing both operations in View.post() resolves the issue.
Because the addition of a header view is synchronous, but view removal is done in View.post(), there can be a case when two adds happen in a row, and it can lead to a crash. Performing both operations in View.post() resolves the issue.