我将我的数据库连接到 ListView,如下所示:
public void update_list(String NN) {
c = db.rawQuery(NN, null);
startManagingCursor(c);
String[] from = new String[]{"_id","Fname","Lname","Phone","Car","CarNum" };
int[] to = new int[]{ R.id._id,R.id.Fname,R.id.Lname,R.id.Phone,R.id.Car,R.id.CarNum };
SimpleCursorAdapter notes = new SimpleCursorAdapter (this, R.layout.my_list, c, from, to);
setListAdapter(notes);
setListAdapter(new SimpleCursorAdapter(this, R.layout.my_list, c, from,to) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = super.getView(position, convertView, parent);
}
});
}
现在我需要将 ImageView 连接到图片
我有字段 PicNum 保存图片链接
我知道像这样将图片加载到 ImageView:
MyPic = (ImageView) findViewById(R.id.MyPic);
try
{
File imgFile = new File("/sdcard/MyPic/Unzip/" +MyParam.zPicNum+ ".jpeg");
if(imgFile.exists()){
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
MyPic.setImageBitmap(myBitmap);
}
else
{
MyPic.setImageBitmap(null);
}
}
catch (Exception e) {
MyPic.setImageBitmap(null);
}
如何将此 ImageView 结合到我的 ListView ?