Created
November 27, 2017 13:24
-
-
Save TMalygin/8a81da31bba32ce29b31a172242544cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
final List<News> result = new ArrayList<>(); | |
CountDownLatch countDownLatch = new CountDownLatch(1); | |
Api.<GetNewsMethod>createMethod(ApiKeys.GET_NEWS) | |
.setCallback(new GetNewsMethod.GetNewsResult() { | |
@Override | |
public void showLoading() {} | |
@Override | |
public void onNewsLoaded(@NonNull List<News> news) { | |
assertFalse(news.isEmpty()); | |
result.addAll(news); | |
countDownLatch.countDown(); | |
} | |
@Override | |
public void onError(@Nullable String msg) { | |
fail(msg); | |
countDownLatch.countDown(); | |
} | |
}).send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment