SCCapstone / 5chords

Current APK is included in the v1.0 release
http://sccapstone.github.io/5chords/
Apache License 2.0
0 stars 1 forks source link

App crashes after many activity changes #61

Closed zeagler closed 8 years ago

zeagler commented 8 years ago

When I quickly move between activities the app will crash at some point with an inflation error.

Binary XML file line #105: Error inflating class <unknown>

To reproduce error: use navigation drawer to move between help about history activities. Click Done on new activity. Move through 4 or 5 activity changes until it crashes.

tstone95 commented 8 years ago

It seems to be caused be an java.lang.OutOfMemoryError. It looks like some images are using too much memory and are not being saved. memerror

tstone95 commented 8 years ago

I suspect it is the background image; that is about 4.24 MB.

zeagler commented 8 years ago

Should we 1) remove the background image 2) destroy the unused resources our self 3) Use a FrameLayout to display fragments over in an ImageView containing the background

tstone95 commented 8 years ago

I think it is only a problem with the 'Done' button. The activities are never removed from the back stack when the user returns to the Main Activity. I noticed that when using the Android back button I don't get the problem. If this is the case I should be able to fix he problem momentarily.

tstone95 commented 8 years ago

I fixed the issue where Activities were not being removed from the back stack but this did not fix the memory problem. I guess we need to free up the resources our selves, although I am not sure why memory is being accumulated anyway.

zeagler commented 8 years ago

We have a build up of resources as they are never destroyed, finish() will dereference and clean up all the resources of an activity.

zeagler commented 8 years ago

Bonus: we go back to the previous activity instead of creating new ones so every slider and option is as it was.