I am totaly new to android and just want to know if it is any working and possible way to update the UI outside the main thread. Just from my code I have listed below I know
A worker thread never can update main thread because only main thread can render the UI elements (TextView, EditText etc.) and if we try to update for sure we are going to an exception.
myAcitity.runOnUiThread(new Runnable() {
public void run() {
//here you can update your UI elements because this code is going to executed by main thread
}
});
Otherwise you can use post method of View class
myView.post(new Runnable() {
public void run() {
//here you can update your UI elements because this code is going to executed by main thread
}
});