我在 Android 查询中很新鲜,所以现在使用 AndroidQuery,这里有 header 参数,但是另一个 url,其他 post 参数是必要的。
这里不能执行下一个回调方法,
public static String getcodeJsonString(Context context2) {
aQuery = new AQuery(context2);
String url = Url.urlgetCode;
AjaxCallback<String> callBack = new AjaxCallback<String>();
callBack.header("username", "bimx");
callBack.header("password", "pwd");
aQuery.ajax(callBack);
callBack.url(url).type(String.class).weakHandler(context2, "CodeCallback");
return code;
}
和回调方法,Log 无法打印,为什么不调用CodeCallback方法。
public void CodeCallback(String url, String jsonString, Context context, AjaxStatus status) {
Log.i("AQueryOputpu", "Json on String=" + jsonString);
code = json;
}
任何想法,我在哪里做错了。提前谢谢你。