Android App crashing on Samsung Galaxy S3 (out of memory error)

前端 未结 4 2035
借酒劲吻你
借酒劲吻你 2021-02-05 13:02

I have an Android app that takes some pictures, re-sizes them and sends them over to the back-end server. This app works perfectly fine on all other phones (Gingerbread and Ice

4条回答
  •  情深已故
    2021-02-05 13:40

    I overwrote the onDestroy method and added the following line: layout.setBackgroundDrawable(null);. Please let me know if this worked or didn't work for you. 
    

    – user881148

    Cool, it worked for me... with a little added for background pics on a layout. Instead of using BitmapDrawables or Bitmap I use Drawables after convert from bitmap.

    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.outerspace);
    Drawable bitDraw = new BitmapDrawable(getResources(), bitmap);
    
    main.setBackgroundDrawable(bitDraw);
    

    My issue was that is was working on all devices expect for the S3 (which was annoying). But the app is up and running now! Thanx...user881148

提交回复
热议问题