I created a class and I want it's methods to be available to call only from one specific thread, for instance, the ui-thread. It's exactly the opposite from what happens in the android networking api... it throws an exception when it is called from the ui-thread. How can I do that in android? thanx
Forcing class methods to be called from ui thread
161 Views Asked by Sebastian Breit At
3
Well, you can do it even inside your class. Just, get the context of caller activity. And in the method, do
context.runOnUIThread()