In this case, you run on UI Thread:
new Thread() {
@Overridepublic void run() {
try {
// code runs in a thread
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
// code runs in a UI(main) thread
}
});
} catch (final Exception ex) {
}
}
}.start();
To make this easier (or harder in some cases), there's AsyncTask.
No comments:
Post a Comment