Where to use:
Already one thread is running in our application ,In the same thread You want to update UI thread ,following code will help You.
"Calling the child thread if parent thread functionality changing every time."
Sample code:
---------------------------
//Parent thread
@Override
public void onMessage(final String message) {
//child thread
runOnUiThread(new Runnable() {
@Override
public void run() {
// UI Updations
t.append("\n"+message);
}
});
}
Already one thread is running in our application ,In the same thread You want to update UI thread ,following code will help You.
"Calling the child thread if parent thread functionality changing every time."
Sample code:
---------------------------
//Parent thread
@Override
public void onMessage(final String message) {
//child thread
runOnUiThread(new Runnable() {
@Override
public void run() {
// UI Updations
t.append("\n"+message);
}
});
}
No comments:
Post a Comment