Preventing empty app process under Android -
i porting existing windows 8 / ios app android.
of course, want re-use of program logic / control flow possible. unfortunately, android has strange concept of activities. (i use 1 single activity because app game.)
the problem have following:
- static variables not bound activity lifetime process lifetime.
- my activity can destroyed while process still alive. (be through configuration change or due low memory)
- but have sure newly created activity gets "fresh" static variables.
i solve problem
- preventing activity restarts due configuration changes (that's fine because not use layouts or size-dependent resources)
and @ same time
- assuring when activity destroyed (e.g. user switches app, memory low), whole process destroyed, too.
the later 1 question: how make sure app process killed whenever there no activities alive? (in understanding, not impossible, unfortunately, empty processes exist)
Comments
Post a Comment