FileDocCategorySizeDatePackage
PreferenceInflater.javaAPI DocAndroid 1.5 API3406Wed May 06 22:41:56 BST 2009android.preference

PreferenceInflater

public 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
Constructors Summary
public PreferenceInflater(android.content.Context context, PreferenceManager preferenceManager)

    
         
        super(context);
        init(preferenceManager);
    
PreferenceInflater(GenericInflater original, PreferenceManager preferenceManager, android.content.Context newContext)

        super(original, newContext);
        init(preferenceManager);
    
Methods Summary
public GenericInflatercloneInContext(android.content.Context newContext)

        return new PreferenceInflater(this, mPreferenceManager, newContext);
    
private voidinit(PreferenceManager preferenceManager)

        mPreferenceManager = preferenceManager;
        setDefaultPackage("android.preference.");
    
protected booleanonCreateCustomFromTag(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 PreferenceGrouponMergeRoots(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;
        }