Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ControllerReview implements Callback<List<reviewResult>> {
- public Context context;
- static final String BASE_URL = "http://busboosted.000webhostapp.com/";
- public void start(final Context context, String login, String password, Callback<List<reviewResult>> callback) {
- Gson gson = new GsonBuilder()
- .setLenient()
- .create();
- this.context = context;
- Retrofit retrofit = new Retrofit.Builder()
- .baseUrl(BASE_URL)
- .addConverterFactory(GsonConverterFactory.create(gson))
- .build();
- Api gerritAPI = retrofit.create(Api.class);
- Call<List<reviewResult>> call = gerritAPI.getReview();
- call.enqueue(new Callback<List<reviewResult>>() {
- @Override
- public void onResponse(Call<List<reviewResult>> call, Response<List<reviewResult>> response) {
- List<reviewResult> res = response.body();
- res.getReview();//how to get a list?
- }
- @Override
- public void onFailure(Call<List<reviewResult>> call, Throwable t) {
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement