ユーザーのFacebookIDをMySQLテーブルに記録するこのアプリを入手しました。このIDを取得して、ユーザーのプロフィール写真をListViewに表示しようとしていますが、何が間違っているのかわかりません。
私のカスタムArrayAdapter:
public class VisualAdapter extends ArrayAdapter<String> {
private final Context contexto;
private final String[] comics, username, userid;
URL img_url = null;
Bitmap bm;
public VisualAdapter(Context contexto, String[] comics, String[] username,
String[] userid) {
super(contexto, R.layout.exibeimg, comics);
this.contexto = contexto;
this.comics = comics;
this.username = username;
this.userid = userid;
}
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
LayoutInflater inflater = (LayoutInflater) contexto
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.exibeimg, parent, false);
TextView textView = (TextView) rowView.findViewById(R.id.tvTitleImage);
ImageView imageView = (ImageView) rowView.findViewById(R.id.ivImageVisual);
ImageView ivUser = (ImageView) rowView.findViewById(R.id.ivUser);
TextView tvUser = (TextView) rowView.findViewById(R.id.tvUserNAME);
textView.setText(comics[position]);
tvUser.setText(username[position]);
try {
img_url = new URL("http://graph.facebook.com/"+userid+"/picture?type=thumbnail");
bm = BitmapFactory.decodeStream(img_url.openConnection().getInputStream());
ivUser.setImageBitmap(bm);
}
catch (Exception e) {
e.printStackTrace();
}
return rowView;
}
}
Logcat: http: //pastebin.com/kmLXKvZJ
また、これはタブの内側にあります。これはタブ2にあり、タブ2をクリックしてアプリがタブ1で起動すると(このリストを表示するには)、ロードに数秒かかりますが、ロードを高速化するためにできることはありますか?