Tested on both 1.5-R2 and R3, same result.

On Aug 6, 10:22 pm, efan <e...@efansoftware.com> wrote:
> http://developer.android.com/reference/android/app/Activity.html
>
> The Activity Lifecycle could have implementation and or design bug:
> One case is to initialize a big image in onCreate(), try to reuse the
> image during the whole lifecycle, and then recycle the image in
> onDestroy().
> Test showed that onCreate() is called every time one navigate away
> from the activity and back again, but onDestroy() is not called at
> all. This behavour causes memory leaking for the big image (size
> 960*1920). After 6+ times away and back to activity, the system runs
> out of memory and has to kill the process.
>
> One workaround is to initialize the big image in onResume() and
> recycle in onPause(), but that's not so good reuse.
>
> Could it be better to change the process (as shown in the diagram) a
> little bit such as:
> Call onDestroy() first when a process is killed?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to