@btate -
Thanks for a great piece of code. I'm implementing some pretty heavy Fragments and getting OOM errors after a while. It looks like it's generating more Fragments than it's destroying.
As an example, if we assume the cell 4,1 in a 5x5 matrix is the heavyweight Fragment, and I assign a static variable "instances" which i increment in the Fragment's onCreateView(), decrement it on onDestroyView(), Logcat shows me that when I scroll around, the variable instances keeps growing, and only occasionally decrements when I'm far enough away from cell 4,1.
I suspect it's something to do with the pre-fetching either side of the active cell. Any ideas? I can poke around, but couldn't quite figure it out.
Neil
@btate -
Thanks for a great piece of code. I'm implementing some pretty heavy Fragments and getting OOM errors after a while. It looks like it's generating more Fragments than it's destroying.
As an example, if we assume the cell 4,1 in a 5x5 matrix is the heavyweight Fragment, and I assign a static variable "instances" which i increment in the Fragment's onCreateView(), decrement it on onDestroyView(), Logcat shows me that when I scroll around, the variable instances keeps growing, and only occasionally decrements when I'm far enough away from cell 4,1.
I suspect it's something to do with the pre-fetching either side of the active cell. Any ideas? I can poke around, but couldn't quite figure it out.
Neil