Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. public class DialogUtils {
  2.  
  3. public static ProgressDialog showProgressDialog(Context context, String message) {
  4. ProgressDialog m_Dialog = new ProgressDialog(context);
  5. m_Dialog.setMessage(message);
  6. m_Dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  7. m_Dialog.setCancelable(false);
  8. m_Dialog.show();
  9. return m_Dialog;
  10.  
  11. }
  12.  
  13. m_Dialog = DialogUtils.showProgressDialog(getContext(), "Loading...");
  14.  
  15. final String m_DealListingURL = "http://202.131.1.132:8080/ireward/rest/json/metallica/getDealListInJSON";
  16. JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, m_DealListingURL, jsonObject, new Response.Listener<JSONObject>() {
  17. @Override
  18. public void onResponse(JSONObject response) {
  19. Log.i(TAG, "Server Response:-" + response);
  20. if (m_Dialog != null && m_Dialog.isShowing()) {
  21. m_Dialog.dismiss();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement