Answer the question
In order to leave comments, you need to log in
Android testing. How to test a real asynchronous response?
There is a method with asynchronous response
public void doSomethingAsynchronously (final DummyCallback callback) {
new Thread(new Runnable() {
@Override
public void run() {
try {
Object obj = Database.get(some_arg)
callback.onSuccess(obj);
} catch (InterruptedException e) {
callback.onFail(ERROR_CODE);
e.printStackTrace();
}
}
}).start();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question