Yes, I create an new adapter with saved value and set it in the view pager. 
I did the date calculation in the adapter constructor.  365 value is index 
of date. I can get date object from the adapter's getDate method. I am sure 
this index is exist in adapter. I think the problem is that the view pager 
can't keep the current value and it loads the previous value when the 
orientation is occured. I debugged the process. When the orientation 
change, oncreate method is called and as soon as onCreate method is 
finished, onPageSelected method is called. In onPageSelected method, the 
position is not the value that I set in the onCreate method.

Thanks again.

On Monday, August 5, 2013 2:29:36 PM UTC+6:30, TreKing wrote:
>
>
> On Mon, Aug 5, 2013 at 2:51 AM, julia <[email protected] 
> <javascript:>>wrote:
>
>> Yes, I saved the date value, I mean the old position of view pager is 
>> still exist even I set the new current item position in onCreate method. I 
>> print out the position value in the onPageSelected method. I got the old 
>> position value.
>>
>
> Well, for starters, in your code you are explicitly setting the value to 
> 365, not using a saved value, from what I can tell.
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago 
> transit tracking app for Android-powered devices
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to