tlmarker1968

Untitled

Jun 7th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | None | 0 0
  1.     private void readUsers() {
  2.         userList.clear();
  3.         managerAdminApi.user(new Callback<ArrayList<ObjectUser>>() {
  4.             @Override
  5.             public void onResponse(@NonNull Call<ArrayList<ObjectUser>> call, @NonNull Response<ArrayList<ObjectUser>> response) {
  6.                 //ArrayList<ObjectUser> JsonObject = response.body();
  7.                 Object JsonObject = response.body();
  8.                 ArrayList<ObjectUser> JsonList = JsonObject.data;
  9.                 for (int i = 0; i < requireNonNull(JsonList).size(); i++) {
  10.                     userList.add(new ObjectUser(
  11.                             JsonList.get(i).getId(),
  12.                             JsonList.get(i).getUsername(),
  13.                             JsonList.get(i).getPassword(),
  14.                             JsonList.get(i).getCreated(),
  15.                             JsonList.get(i).getModified(),
  16.                             JsonList.get(i).getGrade(),
  17.                             JsonList.get(i).getDepartment()
  18.                     ));
  19.                 }
  20.                 uAdapter.notifyDataSetChanged();
  21.             }
  22.  
  23.             @Override
  24.             public void onFailure(@NonNull Call<ArrayList<ObjectUser>> call, @NonNull Throwable t) {
  25.             }
  26.         });
Add Comment
Please, Sign In to add comment