Discussion Forums  >  Crashes, Memory Warnings

Replies: 4    Views: 198

Eric F
Lost but trying
Profile
Posts: 13
Reg: Mar 21, 2013
Clovis
3,380
10/09/13 06:22 AM (10 years ago)

Menu Button images is crashing my VM

I have been trying to find a fix for a VM problem in my android app for a couple of months now. Basically, I have a simple app that links multiple menu button screens. Each menu button screen I have a different background image and also multiple button images. Each of the background images are less than 80 kb and they are set to a 640x960 ratio. Then button images are mostly 5 kb and smaller with a 125x125 ratio. The question I have as I have looked throughout the source code files in eclipse, is there a way that when I press a menu botton to change pages that it automatically clears the previous background/menu button images so it always has to load new on each press instead of from the cache. It seems to me that garbage collector cannot delete from the VM because they are not released from being referenced even after I switch to a different screen. I have tried downloading a clean project multiple times, shut down and restarted eclipse. Also, if there is a fix to put in code, I am a novice at this so more step by step help would be greatly appreciated. Thanks!
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
10/09/13 02:30 PM (10 years ago)
This may sound weird but give it a try: Copy all your header image files into each of the drawable subfolders in the /res folder (drawable-hdpi, drawable-ldpi, drawable-mdpi, etc.). Might work, might not. Interested to know either way. Solved a similar problem with one of my apps yesterday. Tim
 
Eric F
Lost but trying
Profile
Posts: 13
Reg: Mar 21, 2013
Clovis
3,380
like
10/10/13 01:49 PM (10 years ago)
Tim, That did seem weird, but it looks like that fixed the problem. Thanks for the help...that solved a 4 month problem for me. Eric
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
10/10/13 03:21 PM (10 years ago)
Glad it worked. Susan should get credit for this as she mentioned it to me while trying to fix a similar issue I was having. I think some rethinking of how we put together all the extraneous files for Android is in order. Tim
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
10/10/13 06:06 PM (10 years ago)
I need to update the Menu with Image with my own advice! I built it to be simple, so we wouldn't have to mess with image sizes. But I don't know any way around it with Android.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.