Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArrayList<ModelContact> listContact = new ArrayList<>();
- ModelContact c = new ModelContact("5", "OFF", "Test", "12134567", "14646", "email@email.com", "Adress");
- listContact.add(c);
- c = new ModelContact("6", "ON", "Test2", "12123456", "14646", "email@email.com", "Adress");
- listContact.add(c);
- Call<List<ModelContact>> callM = contactInterface.createRContact(listContact);
- callM.enqueue(new Callback<List<ModelContact>>() {
- @Override
- public void onResponse(Response<List<ModelContact>> response, Retrofit retrofit) {
- Log.i("TAG", "Success");
- }
- @Override
- public void onFailure(Throwable t) {
- Log.i("TAG", "Error: " + t.getMessage());
- }
- });
- public interface ContactInterface {
- @GET("recieve")
- Call<List<ModelContact>> getRContact();
- @POST("send")
- Call<List<ModelContact>> createRContact(@Body ArrayList<ModelContact> modelContact);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement