PreferenceInflaterpublic class PreferenceInflater extends GenericInflater The {@link PreferenceInflater} is used to inflate preference hierarchies from
XML files.
Do not construct this directly, instead use
{@link Context#getSystemService(String)} with
{@link Context#PREFERENCE_INFLATER_SERVICE}. |
Fields Summary |
---|
private static final String | TAG | private static final String | INTENT_TAG_NAME | private PreferenceManager | mPreferenceManager |
Methods Summary |
---|
public GenericInflater | cloneInContext(android.content.Context newContext)
return new PreferenceInflater(this, mPreferenceManager, newContext);
| private void | init(PreferenceManager preferenceManager)
mPreferenceManager = preferenceManager;
setDefaultPackage("android.preference.");
| protected boolean | onCreateCustomFromTag(org.xmlpull.v1.XmlPullParser parser, Preference parentPreference, android.util.AttributeSet attrs)
final String tag = parser.getName();
if (tag.equals(INTENT_TAG_NAME)) {
Intent intent = null;
try {
intent = Intent.parseIntent(getContext().getResources(), parser, attrs);
} catch (IOException e) {
Log.w(TAG, "Could not parse Intent.");
Log.w(TAG, e);
}
if (intent != null) {
parentPreference.setIntent(intent);
}
return true;
}
return false;
| protected PreferenceGroup | onMergeRoots(PreferenceGroup givenRoot, boolean attachToGivenRoot, PreferenceGroup xmlRoot)
// If we were given a Preferences, use it as the root (ignoring the root
// Preferences from the XML file).
if (givenRoot == null) {
xmlRoot.onAttachedToHierarchy(mPreferenceManager);
return xmlRoot;
} else {
return givenRoot;
}
|
|