摘要:
原文地址:Android加载大图片内存溢出的问题总结作者:風中靜思_2011写Android代码也有那么三四个月的时间了,也一直都是菜鸟,很多东西都只是拿来就用,也没有想太多的细节问题。之前在程序中遇到图片资源的时候,总是使用BitmapFactory.decodeResource来设置图片资源,也没发现什么问题。前段时间在写一个动态壁纸程序的时候,可能图片资源比较多,毕竟手机内存还是有限的,程序跑起来有时会抛outof Memory异常。后来改用BitmapFactory.decodeStream方法,好像能解决问题。后来在程序中去测试对比了一下,发现还是有比较大的差别的。同样是加载十张图片 阅读全文
posted @ 2012-10-24 09:09
郑文亮
阅读(757)
评论(2)
推荐(3)
摘要:
方法一Java codeFile file=new File("/sdcard/IMG/1.jpg"); Intent it =new Intent(Intent.ACTION_VIEW); Uri mUri = Uri.parse("file://"+file.getPath()); it.setDataAndType(mUri, "image/*"); startActivity(it);方法二Java codeComponentName componentName=new ComponentName("com.cool 阅读全文
posted @ 2012-10-24 08:41
郑文亮
阅读(4769)
评论(0)
推荐(0)