i am trying to display image from internet in my imageview.
which is raising following error any one guide me what mistake am i doing here
public Bitmap DisplayLiveImage(String ImageSrc) { Bitmap bm; try {
URL aURL = new URL(ImageSrc);
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = null;
try
{
is= conn.getInputStream();
}catch(IOException e)
{
return null;
}
BufferedInputStream bis = new BufferedInputStream(is);
bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
} catch (IOException e) {
return null;
}
return bm;
}
logcat
11-12 21:45:22.509: ERROR/AndroidRuntime(7118): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:476)
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:537)
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at com.Finditnear.FindItNearActivityWithoutMenu.DisplayLiveImage
(FindItNearActivityWithoutMenu.java:149)
11-12 21:45:22.509: ERROR/AndroidRuntime(7118): at com.Finditnear.ViewSingleImage$1.run
(ViewSingleImage.java:88)
any help would be appreciated.