私はAndroidカスタムリストビューアダプターを持っています、
一部の画像をcustom-row-layout/ImageViewにストリーミング/ロードする必要があります。
だから私は試してみました:
myImageView.setImageBitmap(BitmapFactory.decodeFile(o.getIcon_url()));
以下のこのコードのように。
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.row_applications, null);
}
ApplicationsModel o = items.get(position);
if (o != null) {
ImageView tv_icon = (ImageView) v.findViewById(R.id.iv_icon);
if(row_icon !=null)
{
tv_icon.setImageBitmap(BitmapFactory.decodeFile(o.getIcon_url()));
}
}
return v;
}
しかし、私のカスタムリストビューでは画像が読み込まれません。
コードはTextViewで動作します。