I tried + tmho to answer, but it still gives this error:
E / AndroidRuntime (****): android.view.ViewRootImpl $ CalledFromWrongThreadException: only the source thread that created the view hierarchy can touch its views.
I finally end the combination with the + ingsaurabh method, for example:
private class ResponseHandler implements Observer, Runnable { Activity act; public ResponseHandler(Activity caller) { act = caller; } @Override public void update (Observable obj, Object arg) { act.runOnUiThread(this); } @Override public void run() {
Thanks to both of you.
Ohad cohen
source share