Advertisement
Guest User

Untitled

a guest
Dec 29th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ArrayList<ModelContact> listContact = new ArrayList<>();
  2.  
  3. ModelContact c = new ModelContact("5", "OFF", "Test", "12134567", "14646", "email@email.com", "Adress");
  4. listContact.add(c);
  5. c = new ModelContact("6", "ON", "Test2", "12123456", "14646", "email@email.com", "Adress");
  6. listContact.add(c);
  7.  
  8. Call<List<ModelContact>> callM = contactInterface.createRContact(listContact);
  9. callM.enqueue(new Callback<List<ModelContact>>() {
  10. @Override
  11.  
  12. public void onResponse(Response<List<ModelContact>> response, Retrofit retrofit) {
  13. Log.i("TAG", "Success");
  14. }
  15.  
  16. @Override
  17. public void onFailure(Throwable t) {
  18. Log.i("TAG", "Error: " + t.getMessage());
  19. }
  20. });
  21.  
  22. public interface ContactInterface {
  23.  
  24. @GET("recieve")
  25. Call<List<ModelContact>> getRContact();
  26.  
  27. @POST("send")
  28. Call<List<ModelContact>> createRContact(@Body ArrayList<ModelContact> modelContact);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement