*JsonObject json为空,但导致onCompleted函数工作正常并正确返回 json 数据,但我不能在oncompleted函数之外使用它*
final JsonObject json = new JsonObject();
Ion.with(MainActivity.this)
.load("https://wordsapiv1.p.mashape.com/words/" + searchedWord)
.setHeader("X-Mashape-Key","I've hidden the Key !")
.asJsonObject()
.setCallback(new FutureCallback<JsonObject>() {
@Override
public void onCompleted(Exception e, JsonObject result) {
Log.i("result: ","" + result);
Log.i("json: ", "" + json);
}
});