I will try to make it simple:
In my main activity, I do a handler:
public class ARViewer extends ARDisplayActivity { public final MHandler mHandler = new MHandler(this); public void onCreate(Bundle savedInstanceState) { ...
MHandler Class:
public final class MHandler extends Handler{
But if I call the handleMessage method from a callback function in another class, definitely from a different thread, I still get the error message: CalledFromWrongThreadException (Only the original thread that created a view hierarchy can touch its views) :
public void rFound(Route route) { Message msg = new Message(); msg.what = MHandler.H_RR; ARViewer.arnv.mHandler.handleMessage(msg); }
source share