interview: Child threads must not be able to update the UI? Surfaceview: Multimedia video playback, you can update the UI in a child thread, Progress related controls: You can also update the UI in a child thread; audit mechanism: When the activity is fully displayed, the audit mechanism detects that the child thread has not updated the UI.
1. Update the UI using the activity's Runonuithread method, which will be executed on the main thread, regardless of whether or not the current threads are main thread.
Runonuithread (New Runnable () {
@Override
Public void Run () {
Tv_simple.settext ("I have been updated");
}
});
2. Using the handler direct post to the main thread, handler needs to be created in the main thread
//Delay how many millimeters to perform runnable.
mhandler.postdelayed (New Runnable () {
@Override
Public void Run () {
Tv_simple.settext ("I have been updated");
}
}, 1000*5);
Application Scenario: After the ad shows, do the page jump.
Common message Processing APIs