Guest User

Untitled

a guest
Sep 28th, 2017
1,666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. public void Productlistcall()
  2. {
  3. showpDialog();
  4.  
  5.  
  6. JSONObject jsonParams = new JSONObject();
  7.  
  8. if(filter_items!=null)
  9. {
  10. try {
  11. jsonParams.put("typeName", "MANUFACTURER");
  12. jsonParams.put("typeId", "22");
  13. jsonParams.put("cityId","308");
  14. jsonParams.put("sortBy", "productname");
  15. jsonParams.put("sortOrder", "desc");
  16. } catch (JSONException e) {
  17. e.printStackTrace();
  18. }
  19.  
  20. JSONArray array=new JSONArray();
  21. JSONObject obj=new JSONObject();
  22. String filtersepid = null;
  23. System.out.println("FILTER LIST DATA IS NOT NULL");
  24.  
  25. for(int i=0;i<filter_items.size();i++)
  26. {
  27. filtersepid=filter_items.get(i);
  28. System.out.println("filtersepid"+filtersepid);
  29. try {
  30. obj.put("filterId",filter_items.get(i));
  31. obj.put("typeName","CAT_ID");
  32. } catch (JSONException e) {
  33. e.printStackTrace();
  34. }
  35. array.put(obj);
  36.  
  37. }
  38. try {
  39. jsonParams.put("filter",array.toString());
  40. } catch (JSONException e) {
  41. e.printStackTrace();
  42. }
  43. }
  44. else
  45. {
  46. try {
  47. jsonParams.put("typeName", "MANUFACTURER");
  48. jsonParams.put("typeId", "22");
  49. jsonParams.put("cityId", "308");
  50. jsonParams.put("sortBy", "productname");
  51. jsonParams.put("sortOrder", "desc");
  52. } catch (JSONException e) {
  53. e.printStackTrace();
  54. }
  55.  
  56. System.out.println("FILTER LIST DATA IS NULL");
  57. }
  58.  
  59. System.out.println("DRAWER PARAMS" + jsonParams);
  60. JsonObjectRequest postRequest = new JsonObjectRequest( Request.Method.POST, urls, jsonParams,
  61. new Response.Listener<JSONObject>() {
  62. @Override
  63. public void onResponse(JSONObject response) {....
Add Comment
Please, Sign In to add comment