public void getJson(View v) {
HttpUtils httpUtils = new HttpUtils();
String path = "http://v.juhe.cn/weixin/query?key=0917c812f187b92e025c9b7c2d4e59b5&pno=2";
httpUtils.send(HttpMethod.GET, path, new RequestCallBack<String>() {
private ArrayList<MyList> list;
@Override
public void onFailure(HttpException arg0, String arg1) {
Toast.makeText(MainActivity.this, "请求失败", 0).show();
public void onSuccess(ResponseInfo<String> info) {
String result = info.result;
Gson gson = new Gson();
News news = gson.fromJson(result, News.class);
}
HttpUtils httpUtils = new HttpUtils();
String path = "http://v.juhe.cn/weixin/query?key=0917c812f187b92e025c9b7c2d4e59b5&pno=2";
httpUtils.send(HttpMethod.GET, path, new RequestCallBack<String>() {
private ArrayList<MyList> list;
@Override
public void onFailure(HttpException arg0, String arg1) {
Toast.makeText(MainActivity.this, "请求失败", 0).show();
}
//请求成功
public void onSuccess(ResponseInfo<String> info) {
String result = info.result;
Gson gson = new Gson();
News news = gson.fromJson(result, News.class);
}