In my Android layout, I have a TextView. This TextView displays a fairly large text that can be expanded, and it can scroll. Now that the phone is rotated, the view is destroyed and created, and I must set Text Text () TextView again, resetting the scroll position to the beginning.
I know that I can use getScrolly () and scrollTo () to go to the positions of the pixels, but due to a change in the width in the view, the lines become longer and the line that was in the pos 400 pixel can now be 250. Thus It is not very useful.
I need a way to find the first visible line in a TextView in onDestroy (), and then a way to make TextView scroll this text after rotation.
Any ideas?
source share