7

I have created an java class in android studio and I want to use runOnUiThread() in this class. Can I run runOnUiThread() thread without Activity.xml in Android? If Answer is yes? than how?

nisarg parekh
  • 413
  • 4
  • 23

1 Answers1

13

Yes. You just need to use Handler.

 new Handler(Looper.getMainLooper()).post(new Runnable() {
                @Override
                public void run() {

                }
            });
Zeon
  • 535
  • 8
  • 23