How to get response from json using volley in android
<p>I am post Json object data using volley libraries in my app but I want to get response from that request and update UI according to response and also show progressdialog while doing background process.how can I do that please tell me.</p>

<p>here is my code:-</p>

<pre><code>public void postData() {
    try {
        getText();// get Input Text by the user
        String json;// storing json object

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("agentCode", s_szMobileNumber);
        jsonObject.put("pin", s_szOldPassword);
        jsonObject.put("newpin", s_szNewPassword);
        // 4. convert JSONObject to JSON to String
        json = jsonObject.toString();
        System.out.println("Server Request:-" + json);
        JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, CServerAPI.s_szChangePassUrl, jsonObject, new Response.Listener&lt;JSONObject&gt;() {
            @Override
            public void onResponse(JSONObject response) {

            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {

            }
        });

        RequestQueue requestQueue = Volley.newRequestQueue(this);
        requestQueue.add(jsonObjectRequest);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

public void getText() {// getting text from editText.....
    s_szMobileNumber = m_MobileEditText.getText().toString().trim();// get mobile number from edit text
    s_szNewPassword = m_NewPassEditText.getText().toString().trim();// get  new pasword from edit Text
}

public void getResponse() throws JSONException {// method regarding condition.................
    if (m_oResponseobject.getString("resultdescription").equalsIgnoreCase("Transaction Successful")) {
        s_szResponseNewPassword = m_oResponseobject.getString("newpin");// getting  new password response from server....
        CSnackBar.getInstance().showSnackBarSuccess(findViewById(R.id.mainLayout), "Password Changed Successfully", getApplicationContext());
        upDatePassword();// updating password in shared preference.......

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent login = new Intent(getApplicationContext(), CLoginScreen.class);
                startActivity(login);

            }
        }, 3500);


    } else if (m_oResponseobject.getString("resultdescription").equalsIgnoreCase("Subscriber/Agent Not Found")) {
        CSnackBar.getInstance().showSnackBarError(findViewById(R.id.mainLayout), "User not found", getApplicationContext());
    } else if (m_oResponseobject.getString("resultdescription").equalsIgnoreCase("New Pin Can Not Be Empty")) {
        CSnackBar.getInstance().showSnackBarError(findViewById(R.id.mainLayout), "Enter valid password", getApplicationContext());
    } else if (m_oResponseobject.getString("resultdescription").equalsIgnoreCase("Pin Can Not Be Empty")) {
        CSnackBar.getInstance().showSnackBarError(findViewById(R.id.mainLayout), "Old pin not found", getApplicationContext());
    } else if (m_oResponseobject.getString("resultdescription").equalsIgnoreCase("Agentcode Can Not Be Empty")) {
        CSnackBar.getInstance().showSnackBarError(findViewById(R.id.mainLayout), "Enter valid mobile number", getApplicationContext());
    }
}

public void upDatePassword() {// Update old password from new password in shared preference ......
    m_Preferences = getApplicationContext().getSharedPreferences("LoginData", Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = m_Preferences.edit();
    editor.putString("pin", s_szResponseNewPassword);
    editor.apply();
}
</code></pre>