Saturday, December 15, 2012

[android-developers] Re: How to create new PreferenceFragment from XML

On 12/14/2012 09:05 PM, Jim Duda wrote:
>>
>> When selecting the "pref_hosts_title", I want the SettingsActivity$HostsFragment to display.
>> This new fragment does display, however, it doesn't replace the original fragment, it
>> instead overlays the original fragment. The two fragments display at the same time.
>>
>> What might I be doing wrong?
>
> When I select the android:fragment, I've found out that what happens is an entire new
> SettingActivity is started. I was only expecting a new HostsFragment to be created.
> I'm obviously missing something fundamental about the PresenceFragment life cycle.
> I'm reading the docs, but I just don't see my misunderstanding.
>

Well, it turns out I didn't read the documentation well enough. I was using preference
fragments in a preferenceactivity without the preference-headers. So, I was mixing
the OLD and NEW API methodology. Once I realized that I needed preference-headers,
my understanding was corrected.

I hope this helps the next person which makes the same mistake :-)

Jim


--
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

No comments:

Post a Comment