Guest User

Untitled

a guest
Feb 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. enter code here
  2. HashMap<String, String> map = new HashMap<>();
  3. map.put("", Variable Name);
  4. map.put("", Variable Name);
  5.  
  6. TechnicianID.add("0");
  7. Technician.add("Select Technician");
  8.  
  9. appDialogs.showProgressDialog();
  10. callAPiActivity.doPost((Activity) mContext, map, "URL, new GetApiResult() {
  11. @Override
  12. public void onSuccesResult(JSONObject result) throws JSONException {
  13. appDialogs.hideProgressDialog();
  14. JSONArray techArray = result.getJSONArray("data");
  15. for (int i = 0; i < techArray.length(); i++) {
  16. JSONObject techObj = techArray.getJSONObject(i);
  17. TechnicianID.add(techObj.getString("u_id"));
  18. Technician.add(techObj.getString("first_name"));
  19. }
  20.  
  21. TechnicianAdapter = new ArrayAdapter(mContext, R.layout.simple_spinner_item, Technician);
  22. TechnicianAdapter.setDropDownViewResource(android.R.layout.simple_list_item_1);
  23. spinnerTechnician.setAdapter(TechnicianAdapter);
  24.  
  25. }
  26.  
  27. @Override
  28. public void onFailureResult(String messgae) throws JSONException {
  29. appDialogs.hideProgressDialog();
  30. appDialogs.setErrorToast(messgae);
  31. }
  32.  
  33. @Override
  34. public void onNetworkRetry(String messgae) throws JSONException {
  35.  
  36. }
  37.  
  38. });
  39. }
Add Comment
Please, Sign In to add comment