I'm loading images in gridviev asynchronusly.But my gridview displaying only a single image in the last cell of gridview.My adapter class and asynchronus class is given below, thanks.
Adapter class:
class OrderAdapter extends ArrayAdapter<String>
{   
    LayoutInflater inflater;
    String name3[];
    public OrderAdapter(Context context,int resource,LayoutInflater inflater,String name2[])
    {
        super(context, resource,R.id.img,name2);
        this.inflater=inflater;
        this.name3=name2;
    }
    public View getView(int position, View convertView, ViewGroup parent)
    {  
        View row=inflater.inflate(R.layout.row,parent,false);
      final  ImageView img=(ImageView)row.findViewById(R.id.img);
        String imgurl=name3[position];
        Log.e("urlchandan",name3[position]);
        AsyncImageLoaderv asyncImageLoaderv=new AsyncImageLoaderv();
        Bitmap cachedImage = asyncImageLoaderv.loadDrawable(imgurl, new AsyncImageLoaderv.ImageCallback() 
            {
            public void imageLoaded(Bitmap imageDrawable, String imageUrl) {
            img.setImageBitmap(imageDrawable);
            }
            });
        img.setImageBitmap(cachedImage);     
        return row;
    }
}
Asynchronous class
public class AsyncImageLoaderv {
    private HashMap<String, SoftReference<Bitmap>> imageCache;
    public AsyncImageLoaderv() {
        imageCache = new HashMap<String, SoftReference<Bitmap>>();
    }
    public Bitmap loadDrawable(final String imageUrl, final ImageCallback imageCallback) {
        if (imageCache.containsKey(imageUrl)) {
            SoftReference<Bitmap> softReference = imageCache.get(imageUrl);
            Bitmap drawable = softReference.get();
            if (drawable != null) {
                return drawable;
            }
        }
        final Handler handler = new Handler() {
            @Override
                public void handleMessage(Message message) {
                    imageCallback.imageLoaded((Bitmap) message.obj, imageUrl);
                }
        };
        new Thread() {
            @Override
                public void run() {
                    try{
                        Log.d("ur",imageUrl);
                        Bitmap drawable = loadImageFromUrl(imageUrl);
                        imageCache.put(imageUrl, new SoftReference<Bitmap>(drawable));
                        Message message = handler.obtainMessage(0, drawable);
                        handler.sendMessage(message);
                    }catch(Exception e){Log.e("thread stellent",e.toString());}
                }
        }.start();
        return null;
    }
    public static Bitmap loadImageFromUrl(String url) {
            InputStream inputStream;Bitmap b;
            try {
                    inputStream = (InputStream) new URL(url).getContent();
                    BitmapFactory.Options bpo=  new BitmapFactory.Options();
                    bpo.inSampleSize=2;
                   b=BitmapFactory.decodeStream(new PatchInputStream(inputStream), null,bpo );
                    return  b;
            } catch (IOException e) {
                    throw new RuntimeException(e);
                }
//return null;
    }
    public interface ImageCallback {
        public void imageLoaded(Bitmap imageBitmap, String imageUrl);
    }
}
 
     
    