While loading multiple images in ImageView get Out of Memory exception

Hello, I created an application.

In the application, I upload several images from the URL. But during image loading, I get an exception Out Of Memory.

Give me a solution to this problem.

-1
source share
1 answer

Well, now downloading images from the Internet has many solutions. You can also use this Android-Query library https://code.google.com/p/android-query/wiki/ImageLoading . This will give you all the necessary activity. Make sure what you want to do? and read the wiki page. and solve the image upload restriction.

This is my code: -

@Override
public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.row, null);
        }

         ImageView imageview = (ImageView) v.findViewById(R.id.icon);
               AQuery aq = new AQuery(convertView);

               String imageUrl = "http://www.vikispot.com/z/images/vikispot/android-w.png";

              aq.id(imageview).progress(this).image(imageUrl, true, true, 0, 0, new BitmapAjaxCallback(){

                       @Override
                       public void callback(String url, ImageView iv, Bitmap bm, AjaxStatus status){

                           iv.setImageBitmap(bm);


                       }

               });

        }
        return v;
}

+4

All Articles