我试图从我的本地服务器检索信息,并在Android中的简单listView中显示

时间:2016-07-07 12:49:51

标签: java android mysql listview

问题在于图像,如何在listView中显示从服务器下载的位图图像。我已经尝试了互联网上可用的所有方法。我是android编程新手。请帮助我..

update 
    set title = t2.positiontitle
from table1 t1 join
     (select t2.*, row_number() over (partition by employeenumber order by datepositionstart desc) as seqnum
      from table2 t2
     ) t2
     on t1.employeeid = t2.employeenumber and seqnum = 1;

}

1 个答案:

答案 0 :(得分:0)

使用Picasso,Glide或Volley从网络中恢复图像

您的方法将正常工作,直到您滚动。在那之后,所有的混乱将会被回收,一切都将被混乱。

Picasso,Glide和Volley都使用自己的后台线程,Cache Images,这样你就不必一次又一次地下载。他们还可以自己处理视图回收。他们也会尽力防止OutOfMemory Exceptions

我强烈建议使用任何一个。它会为你节省很多时间。

获取图像的整个AsyncTask可以用picasso替换为一行

   Picasso.with(context).load(yoururl).placeholder(anylocalimage).into(yourdesiredlistitem);

滑翔:

https://github.com/bumptech/glide

毕加索:

http://square.github.io/picasso/

排球:(这是凌空的克隆,现在可能已经过时了,请检查)

https://github.com/johnjohndoe/Volley