I am a hobby programmer and am trying to access returnJson outside of the onSuccess function. Inside of the function, I can see that it returns as expected. Could somebody explain why I cannot view it outside and what I can do to make it accessible on the outside?
String returnJson;
client.post(context, url, entity, "application/json", new JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
returnJson = response.toString();
}
});
Log.d("get json",returnJson);