I am displaying images in ViewPager.
The images displayed occupy a lot of space. After showing few images, it throws java.lang.outofMemoryError: Bitmap size exceeds VM bugdet.
Any suggestions on what might be going wrong?
public Object instantiateItem(View pager, int position) {
LayoutInflater inflater = (LayoutInflater) pager.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.fotopager_buttons, null);
TextView text = ((TextView) view.findViewById(R.id.textView1));
text.setText(Global.totalpaging_titlearray[position]);
TextView textprice = ((TextView) view.findViewById(R.id.textprice));
textprice.setText("SAR " + Global.totalpaging_pricearray[position]);
TextView textdesc = ((TextView) view.findViewById(R.id.textdescription));
textdesc.setText(Global.totalpaging_descarray[position]);
ImageView imageView1 = ((ImageView) view.findViewById(R.id.image));
bimage = getBitmapFromURL(Global.totalpaging_array[position]);
imageView1.setImageBitmap(bimage);
((ViewPager) pager).addView(view);
return view;
}