Bitmap load outofmemory android

This question already has an answer here:

  • Strange out of memory issue while loading an image to a Bitmap object 40 answers

  • 请参阅此文档,您将清楚地了解Dispalying位图


    You can try with something like this

    BitmapFactory.Options opts = new BitmapFactory.Options();
    opts.inPreferredConfig = Bitmap.Config.RGB_565; // or Bitmap.Config.ARGB_4444
    sun = BitmapFactory.decodeResource(getResources(), R.drawable.sun, opts);
    

    This is the easiest approach and worth trying. Of course this will make Your graphic worse quality but depending on what they look like You may even not see the difference.

    链接地址: http://www.djcxy.com/p/93100.html

    上一篇: java.lang.OutOfMemoryError:位图大小超过VM预算

    下一篇: 位图加载outofmemory android