runOnUiThread is not a static method.
If you want to run runnable in UIThread, you can use this
Handler handler = new handler (Looper.getMainLooper ());
This will create a handler for the user interface thread.
ClientPlayer extends Activity { . . public static Handler UIHandler; static { UIHandler = new Handler(Looper.getMainLooper()); } public static void runOnUI(Runnable runnable) { UIHandler.post(runnable); } . . . }
Now you can use it anywhere.
@Override public void run() {
Vivek khandelwal
source share