Android Async loading Images in Listview - images are blinking -


I am struggling to load asynchronous images in the ListView, because when they are loaded, some of them blinking (they are replaced by another loaded image again) and some of them show up in the wrong things. Go.

Class to download images:

  class DownloadImageTask extended asyncTask; String, zero, bitmap & gt; {ImageView bmImage; Public DownloadImageTask (ImageView bmImage) {this.bmImage = bmImage; } Protected bitmap doInBackground (string ... url) {string urldisplay = urls [0]; Bitmap mIcon11 = faucet; {InputStream in = new java.net.URL (urldisplay) .openstream (); MIcon11 = BitmapfitterNetExecutestream (in); } Hold (exception e) {} return mIcon11; } Zero (bitmap result) on secure expression {bmImage.setImageBitmap (results); }}   

Call for each item, when I am assigning data to ListView:

  ImageView image = (ImageView) view.findViewById (R .id imageView); TextView Title = (TextView) view.findViewById (R.id.txtTitle); New DownloadImageTask (image). Execute (data.image); Title.setText (data.title);   

What should I do differently? Apart from what Foryn has said, there are many such libraries who actually help in working this way. Here's my personal favorite action:

Say you have an image view and you want to download an image and want to set the imageView to capture that image. . It seems difficult, right? This is done in a row with AQuery:

  aq.id (R.id.name_of_image_view) .image ("http://url-of-image.com/image.png ");   

aq In this case it has been declared as an ashes object:

  AQuery aq = new AQuery () ;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -