1
我使用JSON解析在我的网址非常大尺寸图像在那里,我希望让那些无法下载图像.....任何机构可以帮助我获得这些图像 我的代码如下enter code here
如何解析非常大的图像?
公共类Image延伸活动{
String imageBaseDirectory = "http://www.dha.com.tr/newpics/news/";
Bitmap bit;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.image);
ImageView img=(ImageView)findViewById(R.id.ImageView01);
img.setImageBitmap(convertImage(imageBaseDirectory));
}
公共位图convertImage(字符串或多个) {
URL aURL = null;
try
{
final String imageUrl =s.replaceAll(" ","%20");
Log.e("Image Url",imageUrl);
aURL = new URL(imageUrl);
URLConnection conn = aURL.openConnection();
InputStream is = conn.getInputStream();
//@SuppressWarnings("unused")
BufferedInputStream bis = new BufferedInputStream(is);
Bitmap bm = BitmapFactory.decodeStream(new PatchInputStream(bis));
if(bm==null){}
else
bit=Bitmap.createScaledBitmap(bm,60, 60, true);
return bit;
}
catch(Exception e)
{
e.printStackTrace();
return null;
}
}
重复http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue – 2012-02-21 13:35:50