RequestQueue queue = Volley.newRequestQueue(getActivity().getApplicationContext(), new HurlStack(null, getSSL())); final JsonObjectRequest req = new JsonObjectRequest(Request.Method.POST, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { if (null != jsonObject) { try { String accessToken = (String) jsonObject.get("access_token"); AppPreference.getInstance().setPreference(AppKeys.ACCESS_TOKE N, accessToken); haveAccessToken = true; mHandler.sendEmptyMessage(1); Log.i(getClass().getSimpleName(), accessToken); } catch (JSONException e) { e.printStackTrace(); } Toast.makeText(getActivity().getApplicationContext(), "Login Success", ...