I have a PreferenceActivity that loads two Fragments via the xml file for the headers.
I don’t seem to be able to set a tag or an ID. or a tag for the fragments in the header xml (that is loaded using loadHeaderFromResource();
Since I don’t instantiate it myself I have no ID. or reference to get hold of it.
What do I do?
I don’t think preference fragments loaded via XML are given a tag, and AFAIK they don’t have a known ID, so the only way to do this may be to (1) maintain a separate
List<WeakReference<Fragment>>in yourPreferenceActivityand add to that list in the Activity’sonAttachFragmentand (2) later on, look in that list when you need to find a particular fragment.