Doubt Similar to Time out error volley
I am implementing a login Signup Screen using Localhost The Button which implements the login has the onClick Listener as
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("lala","1");
request=new StringRequest(Request.Method.POST, loginURL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d("lala","3");
try {
JSONObject jsonObject=new JSONObject(response);
boolean sucess=jsonObject.getBoolean("sucess");
if(sucess)
{
Toast.makeText(getApplicationContext(),jsonObject.getString("username").toString()+" Welcome",Toast.LENGTH_LONG).show();
Log.d("lala","4");
}
else
{
Toast.makeText(getApplicationContext()," Failed ",Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
Log.d("lala","5");
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("lala","2");
Log.e("YOUR_APP_LOG_TAG", "I got an error", error);
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
HashMap<String,String> hashMap= new HashMap<String, String>();
hashMap.put("username",e1.getText().toString());
hashMap.put("password",e2.getText().toString());
return hashMap;
}
};
requestQueue.add(request);
}
});
Also my login Url is
http://10.0.2.2/Login.php
The PhP works fine as I have tried and tested it using Postman. Can someone point my mistake over here ? I have looked and looked and can't find any.