How do I run code in the UI thread in an Android JUnit test without an Activity? How do I run code in the UI thread in an Android JUnit test without an Activity? multithreading multithreading

How do I run code in the UI thread in an Android JUnit test without an Activity?


Android.OS.Handler should be able to update the ui.

To use a handler you have to subclass it and overide handleMessage() to process messages

Update:

I am using monodroid, so I dont know if this is completely translatable, But,

You may be able to use

new Handler(context.getMainLooper()).post(runnable);