bla*_*awk 5 java oop android retrofit
在进行网络请求时,retrofit 如何利用接口,首先我们定义接口并将其传递给retrofit 的创建方法,这些东西是如何协同工作的
BooksAPI api = adapter.create(BooksAPI.class);
//Defining the method
api.getBooks(new Callback<List<Book>>() {
@Override
public void success(List<Book> list, Response response) {
//Storing the data in our list
books = list;
//Calling a method to show the list
showList();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
535 次 |
| 最近记录: |