Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ListFragment not retaining scroll position after orientation change
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
havexz  
View profile  
 More options Aug 1 2012, 12:58 am
From: havexz <bali.param...@gmail.com>
Date: Tue, 31 Jul 2012 21:58:19 -0700 (PDT)
Local: Wed, Aug 1 2012 12:58 am
Subject: ListFragment not retaining scroll position after orientation change

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..:-/...?

  MyFrag.java
2K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
havexz  
View profile  
 More options Aug 2 2012, 12:12 am
From: havexz <bali.param...@gmail.com>
Date: Wed, 1 Aug 2012 21:12:22 -0700 (PDT)
Local: Thurs, Aug 2 2012 12:12 am
Subject: Re: ListFragment not retaining scroll position after orientation change

Am I missing something if so does someone knows right way for fixing the
issue?

Thanks in advance.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
havexz  
View profile  
 More options Aug 4 2012, 1:42 pm
From: havexz <bali.param...@gmail.com>
Date: Sat, 4 Aug 2012 10:42:15 -0700 (PDT)
Local: Sat, Aug 4 2012 1:42 pm
Subject: 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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »