Hi, I was interested in this sample after finding a link to it on stackoverflow and I was wondering if you can make things more clear for me. The link to the blog was broken.
stackoverflow link
https://stackoverflow.com/questions/28539216/android-textview-leaks-with-setmovementmethod
In this link you stated that onSaveInstanceState() is called after onStart() so that the spannable string must be set up there and not in the onCreateView() method. Since onStart() is called after onCreateView() I don't see what difference this will make. You said the problem is that the spannable string is replaced with the old copy creating problems.
- If the old copy replaces the new copy, how does this create a leak? There are no variables referencing the new spannable string if the old copy replaces its' spot.
- If the old copy replaces the new copy in
onSaveInstanceState() and onSaveInstanceState() is called after onStart(), doesn't it replace it even if we set the spannable string in onStart()? How is this different from onCreateView().
Hi, I was interested in this sample after finding a link to it on stackoverflow and I was wondering if you can make things more clear for me. The link to the blog was broken.
stackoverflow link
https://stackoverflow.com/questions/28539216/android-textview-leaks-with-setmovementmethod
In this link you stated that
onSaveInstanceState()is called afteronStart()so that the spannable string must be set up there and not in theonCreateView()method. SinceonStart()is called afteronCreateView()I don't see what difference this will make. You said the problem is that the spannable string is replaced with the old copy creating problems.onSaveInstanceState()andonSaveInstanceState()is called afteronStart(), doesn't it replace it even if we set the spannable string inonStart()? How is this different fromonCreateView().