Android Question java.lang.OutOfMemoryError -Binary XML file line #46: Error inflating class android.widget.ImageView

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

Just wondering if anyone knows what might cause the error shown in the txt file attached.?
This error come up in my Google Play developer console as a crash.

I am guessing there is some error in some XML file but can't work out which one?
 

Attachments

  • crash.txt
    2.9 KB · Views: 342

aaronk

Well-Known Member
Licensed User
Longtime User
If I was to use the following code even if the activity doesn't have any layouts already loaded cause a out of memory error?
B4X:
Activity.RemoveAllViews
Activity.LoadLayout("Main")

I seem to every now and then (2-3 times a month) get the error shown in post 1 and I am trying to work out what would cause this error (out of memory error).

It seems to mostly happen on Android 4.4 on a Galaxy Note2 (t0ltevzw), Galaxy Note3 (hltetmo) & Galaxy S5 (kltevzw) devices.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
I am loading the layout file which has the 460x800 image (407KB) set as the background which has the gravity set to fill.
I then have a ImageView which is loading a 125x125 (12.9KB) image into it.

I then have a few labels and that is all.

In my Layout I have a few images in the Image/font files list that I am not using. Does it matter that these images are loaded in that list even knowing I am not using them?

Does it still load them even knowing I am not using them in the layout ?

What do you mean by if I am using Canvas? Is Canvas when you crop images and join them together ?
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
How are you doing it? Are you using the Canvas object?

In my activity I am using this code in Activity_Create to display the layout:
B4X:
Activity.RemoveAllViews
Activity.LoadLayout("top")
Activity.LoadLayout("Main")
Activity.LoadLayout("buttom")

I am loading 3 layout files since top & button are common layouts that are used on all my activity's where Main will be different based on the activity that is shown.

I can't say I am using the Convas object since I don't really know what that is.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
Can you upload your project (File - Export as zip)?
I can't really do that since it's in my fully completed app that I have on Google Play.
I don't really want to release the source code to it.
 
Upvote 0
Top