I am trying to replace the setPreferenceScreen() functionality to
switch to a particular header of my new style Preference Activity.

I cannot find a straightforward way of doing is.

Currently, I am saving the list of headers:

    @Override
    public void onBuildHeaders(List<Header> target)
    {
        loadPreferenceHeadersFromResource(R.xml.id, target);

        this.headers = target;
    }


Then searching for and setting the appropriate one:

    private void switchToHeaderByFragment(Class<?> fragmentClass)
    {
            for (Header header : this.headers)
                if (header.fragment.equals(fragmentClass.getName()))
                {
                    switchToHeader(header);
                    break;
                }
    }


There has to be a better way?  What am I missing?

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

Reply via email to