I'm getting back into programming my game and I can see that I've used activities for so many things. I only have one with a custom-view (my actual game), the others are activities with XML-views, like menus, level-selector, Complete-screen etc.
My question is, Should I not use acitvities for this? and instead create states in my game with different touch-listeners? because I'm afraid of memory-leaks, which tends to come with the use of having activities everywhere.
I destroy all the activities properly before I move onto the next, but still, it feels sloppy somehow. Maybe the startscreen and levelselector are ok, since they are not called in real-time. But my complete-screen is called in real-time through the UI-thread, this just feels wrong.
My heap is already out of control and I dont need any leaks, I already have to limit my app to androids from 2012 and beyond.
So I'm calling out to someone with experience, since this is my first really big game, that I intend to release.
also, if anyone can tell me what these rows that I get in my logcat means, I would really appriciate it, I get that it has to do with heap and allocations, but what is good/bad to have here?
03-20 02:26:23.142: D/dalvikvm(21837): GC_FOR_ALLOC freed 941K, 8% free 14613K/15815K, paused 15ms, total 15ms
03-20 02:26:23.158: I/dalvikvm-heap(21837): Grow heap (frag case) to 17.825MB for 3686416-byte allocation
03-20 02:26:23.181: D/dalvikvm(21837): GC_CONCURRENT freed <1K, 7% free 18212K/19463K, paused 13ms+3ms, total 28ms