Saturday, August 4, 2012

[android-developers] Re: ListFragment not retaining scroll position after orientation change

I found the soln. Just have to specify the 'id' field in the layout xml file and it works fine.

Looking at soln now seems small and silly but why ADT does not create ids for fragments by default like it does for others. Specially when it leads to un-desirable results.

On Wednesday, August 1, 2012 9:12:22 PM UTC-7, havexz wrote:
Am I missing something if so does someone knows right way for fixing the issue?

Thanks in advance.

On Tuesday, July 31, 2012 9:58:19 PM UTC-7, havexz wrote:
After struggling with it for a day, this is what i found.

I am using ListFragment and Loaders with support library.

If I used same/standard Loaders code in a normal Activity it ListView maintains its scroll position very precisely. 

If I am using same/standar Loaders code in ListFragment then if I scroll position is complete lost afte orientation change. And it ListView is scrolled to top.

I also noticed that 'savedInstanceState' is coming as 'null' to for 'onCreate', 'onViewCreated' and 'onActivityCreated', even though I am saving some state in 'onSaveInstanceState'.

Attached is the code for fragment.

I am just wondering...am I alone..:-/...?


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate