I am working on a file manager kind of application in android in which i want to create thumbnails of the images.Thumbnails are getting created but the application often force closes giving out Out Of Memory Exception…
i tried out following code
icon.setImageURI(Uri.parse(path));
icon.setScaleType(ScaleType.FIT_XY);
icon.setLayoutParams(new LinearLayout.LayoutParams(30,30));
addView(icon);
Make sure that when you load the images you specify a sample rate to BitmapFactory.Options. This will keep your bitmaps from getting too big: