public static Boolean click(ActivityTestCase test, final View view) throws Throwable { final CountDownLatch latch = new CountDownLatch(1); final Holder<Boolean> result = new Holder<Boolean>(); test.runTestOnUiThread(new Runnable() { @Override public void run() { result.set(view.performClick()); latch.countDown(); } }); latch.await(10, TimeUnit.SECONDS); return result.get(); }