I have created one custom view that contains the horizontalscrollview. Now when i changes the orientation its scroll state change to 0 every time.
I got the previous scroll state by using onSaveInstanceState(Bundle savedInstanceState) and onRestoreInstanceState(Bundle savedInstanceState) . in onRestoreInstanceState i am using following method to get reposition the scroll,
hoz_scroll.scrollTo(hoz_x_pos, hoz_scroll.getScrollY());
But there is not effect at all.
Help appreciated. Thanks.
If you have to call onCreate every time orientation change the position resets.
You can avoid it by adding orientation changed to manifest but not sure if current scroll state is intact.
I have researched it couple of days ago.If your interface has stadar dimentions on every orientation then you might find an equation by sampling many scroll values.
Create a map with the getScrollY() with values on landscape and portait that displays the same text. More values are better. Then use Polynomial interpolation to create a polynomial equation using matlab or papper.
More values -> more accuracy
http://en.wikipedia.org/wiki/Polynomial_interpolation
also scrolling to a position must be done like this