且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从MySQL数据库中检索BLOB图像和Android的ListView中显示

更新时间:2022-03-13 02:10:39

也许你可以存储在文件夹中的形象
结果
并存储在数据库中的文件夹链接,并通过您的链接检索图像
结果

Maybe you can store the image in folders
and store the folder link in your database, and retrieve the image by your link

   try 
{
    Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(imageUrl).getContent());
    imageView.setImageBitmap(bitmap); 
} 
catch (MalformedURLException e) 
{
      e.printStackTrace();
} 
catch (IOException e)
 {
       e.printStackTrace();
 }