CopyOfMyAsyntaskgbk asyntaskgbk = new CopyOfMyAsyntaskgbk() {
protected void onPostExecute(String result) {
Gson gson = new Gson();
Image_title_bean[] fromJson = gson.fromJson(result,
Image_title_bean[].class);
for (int i = 0; i < fromJson.length; i++) {
ImageView imageView = new ImageView(MainActivity.this);
TextView textView = new TextView(MainActivity.this);
ImageLoader instance = ImageLoader.getInstance();
textView.setText(fromJson[i].type);
DisplayImageOptions demo = MyImageLoder.demo();
instance.displayImage(fromJson[i].imgurl, imageView, demo);
LayoutParams layoutParams = new LayoutParams(100, 100);
layoutParams.setMargins(40, 0, 40, 0);
line_img.addView(imageView, layoutParams);
line_text.addView(textView, layoutParams);
}
}
};
asyntaskgbk
.execute("http://172.17.29.120/localuser/ljy/stest/hottype.json");
protected void onPostExecute(String result) {
Gson gson = new Gson();
Image_title_bean[] fromJson = gson.fromJson(result,
Image_title_bean[].class);
for (int i = 0; i < fromJson.length; i++) {
ImageView imageView = new ImageView(MainActivity.this);
TextView textView = new TextView(MainActivity.this);
ImageLoader instance = ImageLoader.getInstance();
textView.setText(fromJson[i].type);
DisplayImageOptions demo = MyImageLoder.demo();
instance.displayImage(fromJson[i].imgurl, imageView, demo);
LayoutParams layoutParams = new LayoutParams(100, 100);
layoutParams.setMargins(40, 0, 40, 0);
line_img.addView(imageView, layoutParams);
line_text.addView(textView, layoutParams);
}
}
};
asyntaskgbk
.execute("http://172.17.29.120/localuser/ljy/stest/hottype.json");