I am new to android , here if i choose forgot password link it should go to next activity and there if i write correct email then it should setText the correct password from ser
i got the answer...my php code is fine which i posted above the problem is with json object and json array as @Pier Giorgio Misley told me .so here is my updates activity:
StringRequest stringRequest = new StringRequest(Request.Method.POST, url_create_book,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
pDialog.dismiss();
try {
JSONObject object = new JSONObject(response);
// JSONArray jsonArray = object.getJSONArray(0);
// JSONObject jsonObject = jsonArray.getJSONObject(0);
// fetch password from JSON
String password = object.getString("password");
// use password in textviewfemail.setText(password, TextView.BufferType.EDITABLE);
pas.setText(password, TextView.BufferType.EDITABLE);
}
catch (JSONException e) {
Toast.makeText(ForgotPasswordActivity.this, e.toString(), Toast.LENGTH_LONG).show();
}