3

I have a backstack of hidden fragments. I would expect the oldest onces to get detached when memory getting low. Why would I expect that?

  1. Activities have it. Would be nice to have it in fragments.
  2. When the app gets killed (by Android), the hidden fragments are being attached again (restored from the backstack). So there is a scenario for auto-detaching the fragments.

So, is Android detaches hidden fragments when memory gets low while using the app? If not, why not?

AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
  • 2
    "Activities have it" -- no, they don't. http://commonsware.com/blog/2011/10/03/activities-not-destroyed-to-free-heap-space.html – CommonsWare May 06 '13 at 11:09
  • So the answer is NO, because no such mechanism exists in Android. Nor for Activities. Thanks you. Here's the link to Diane's answer: http://stackoverflow.com/a/7576275/435605 – AlikElzin-kilaka May 06 '13 at 14:16
  • This is so strange as I thought I saw this behavior in the past (with activities). – AlikElzin-kilaka May 06 '13 at 14:17
  • @kilaka you should put your discoveries as an answer so that other innocent readers such as myself would be able to realize that this question does have an answer – David T. Apr 04 '14 at 06:16

0 Answers0