Recently encountered a problem, the ListView item loads multiple pictures, and the picture is loaded asynchronously through a child thread in the adapter GetView method.
This time involves the child thread refreshes the main thread in the view problem, generally there are two ways,
1.view.post (Runnable);
2.activity.runonuithread (Runnable);
The first is to use the View.post method to refresh the interface, but has failed to refresh, debug found that the image download has been successful, the View.post method has been called, but the image refresh has not been successful.
Very puzzled, so add log to see a bit, found that the Runnable method has not been called, very strange, but because the project is too tense, temporarily did not investigate the reason, replaced by the second way to refresh,
Activity.runonuithread (), download success log print out after the interface immediately refreshed, temporarily recorded, in the future to find specific reasons.
Android Sub-thread refreshes the main thread in view