In my application, i have 3 screens containing multiple high resolution images. The number of images used in a screen is around 70-75. I have written the code to add images in a grid layout using an adapter class extending BaseAdapter, in the getView() method i wrote the code,
adapter = new ImageAdapter(this);
gridview.setAdapter(adapter);
int x = (int)(width/5.1f);
imageView.setId(position);
imageView.setLayoutParams(new GridView.LayoutParams(x,x));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(4, 20, 4, 20);
but while loading this screen, it show lots of memory issues, and in logcat i am getting the error,
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
Please share how could i write the code to handle memory issues with multiple high resolution images. Thanks.