title: How to resolve errors resulting from Volley post method that does not complete?
body: <p>My mainactivity class is</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  
  private ProgressDialog pDialog;
  private static final String TAG = MainActivity.class.getSimpleName();
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
  
  
  
      RequestQueue queue = Volley.newRequestQueue(this);
      String url="http://onam.leah.in/android_login_api/register_json.php";
  
      JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.POST,url,
              new Response.Listener&lt;JSONObject&gt;() {
                  @Override
                  public void onResponse(JSONObject response) {
                      System.out.println(response);
                      hideDialog();
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      hideDialog();
                  }
              }) {
          protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
              Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
              params.put("user","swaroop");
  
              return params;
          };
      };
      queue.add(jsObjRequest);
  }
  private void showDialog() {
      if (!pDialog.isShowing())
          pDialog.show();
  }
  
  private void hideDialog() {
      if (pDialog.isShowing())
          pDialog.dismiss();
  }
  }
  </code></pre>
  
  <p>I tried to send the the details to url:<a href="http://onam.leah.in/android_login_api/register_json.php,null" rel="nofollow">http://onam.leah.in/android_login_api/register_json.php,null</a></p>
  
  <p>My log cat is below</p>
  
  <blockquote>
    <p>Process: harico.jsonexam2, PID: 21185
        java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.ProgressDialog.isShowing()' on a null object reference
                at harico.jsonexam2.MainActivity.hideDialog(MainActivity.java:75)
                at harico.jsonexam2.MainActivity.access$000(MainActivity.java:29)
                at harico.jsonexam2.MainActivity$2.onErrorResponse(MainActivity.java:57)
                at com.android.volley.Request.deliverError(Request.java:598)
                at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:101)
                at android.os.Handler.handleCallback(Handler.java:739)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5312)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)</p>
  </blockquote>