In my app, when the user clicks on an item in the Main activity, a new Content activity is loaded which displays the contents of the selected item. This content is populated using hundreds of labels in a scrollview, as a listview can't be used due to varying height per item.
Now imagine the user hits the back button when the labels are being added to the ScrollView. While the Content activity will close without any errors, the next time the user selects another item and loads the Content activity, it actually displays the leftover labels from the previous session (i.e the labels that couldn't be added in the previous instance as the user closed the activity with back button).
So my question is how to prevent this? Is there some command I can use in the Activity_Pause of Content activity to clear the UI update queue?
Now imagine the user hits the back button when the labels are being added to the ScrollView. While the Content activity will close without any errors, the next time the user selects another item and loads the Content activity, it actually displays the leftover labels from the previous session (i.e the labels that couldn't be added in the previous instance as the user closed the activity with back button).
So my question is how to prevent this? Is there some command I can use in the Activity_Pause of Content activity to clear the UI update queue?