Hook you can supply that is called when inflating from a LayoutInflater.
You can use this to customize the tag names available in your XML
layout files.
Parameters
parent
View: The parent that the created view will be placed
in; note that this may be null.
name
String: Tag name to be inflated.
context
Context: The context the view is being created in.
attrs
AttributeSet: Inflation attributes as specified in XML file.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# LayoutInflaterFactory\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1 \nDeprecated since version 26.1.0 \n\nLayoutInflaterFactory\n=====================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\n\ninterface\nLayoutInflaterFactory\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------|\n| android.support.v4.view.LayoutInflaterFactory |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This interface was deprecated\nin API level 26.1.0.** \n\nUse [LayoutInflater.Factory2](https://developer.android.com/reference/android/view/LayoutInflater.Factory2.html) directly.\n\nUsed with `LayoutInflaterCompat.setFactory()`. Offers the same API as\n[LayoutInflater.Factory2](https://developer.android.com/reference/android/view/LayoutInflater.Factory2.html).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[View](https://developer.android.com/reference/android/view/View.html) | ` `[onCreateView](/reference/android/support/v4/view/LayoutInflaterFactory#onCreateView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet))`(`[View](https://developer.android.com/reference/android/view/View.html)` parent, String name, `[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)` attrs) ` Hook you can supply that is called when inflating from a LayoutInflater. |\n\nPublic methods\n--------------\n\n### onCreateView\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nView onCreateView (View parent, \n String name, \n Context context, \n AttributeSet attrs)\n```\n\nHook you can supply that is called when inflating from a LayoutInflater.\nYou can use this to customize the tag names available in your XML\nlayout files.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------|\n| `parent` | `View`: The parent that the created view will be placed in; *note that this may be null* . \u003cbr /\u003e |\n| `name` | `String`: Tag name to be inflated. \u003cbr /\u003e |\n| `context` | `Context`: The context the view is being created in. \u003cbr /\u003e |\n| `attrs` | `AttributeSet`: Inflation attributes as specified in XML file. \u003cbr /\u003e |\n\n| Returns ||\n|------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [View](https://developer.android.com/reference/android/view/View.html) | View Newly created view. Return null for the default behavior. \u003cbr /\u003e |\n\n-\n\n Annotations\n -----------\n\n - [ViewPager.DecorView](/reference/android/support/v4/view/ViewPager.DecorView)\n-\n\n Interfaces\n ----------\n\n - [ActionProvider.VisibilityListener](/reference/android/support/v4/view/ActionProvider.VisibilityListener)\n - [AsyncLayoutInflater.OnInflateFinishedListener](/reference/android/support/v4/view/AsyncLayoutInflater.OnInflateFinishedListener)\n - [LayoutInflaterFactory](/reference/android/support/v4/view/LayoutInflaterFactory)\n - [MenuItemCompat.OnActionExpandListener](/reference/android/support/v4/view/MenuItemCompat.OnActionExpandListener)\n - [NestedScrollingChild](/reference/android/support/v4/view/NestedScrollingChild)\n - [NestedScrollingChild2](/reference/android/support/v4/view/NestedScrollingChild2)\n - [NestedScrollingParent](/reference/android/support/v4/view/NestedScrollingParent)\n - [NestedScrollingParent2](/reference/android/support/v4/view/NestedScrollingParent2)\n - [OnApplyWindowInsetsListener](/reference/android/support/v4/view/OnApplyWindowInsetsListener)\n - [ScrollingView](/reference/android/support/v4/view/ScrollingView)\n - [TintableBackgroundView](/reference/android/support/v4/view/TintableBackgroundView)\n - [ViewPager.OnAdapterChangeListener](/reference/android/support/v4/view/ViewPager.OnAdapterChangeListener)\n - [ViewPager.OnPageChangeListener](/reference/android/support/v4/view/ViewPager.OnPageChangeListener)\n - [ViewPager.PageTransformer](/reference/android/support/v4/view/ViewPager.PageTransformer)\n - [ViewPropertyAnimatorListener](/reference/android/support/v4/view/ViewPropertyAnimatorListener)\n - [ViewPropertyAnimatorUpdateListener](/reference/android/support/v4/view/ViewPropertyAnimatorUpdateListener)\n-\n\n Classes\n -------\n\n - [AbsSavedState](/reference/android/support/v4/view/AbsSavedState)\n - [AccessibilityDelegateCompat](/reference/android/support/v4/view/AccessibilityDelegateCompat)\n - [ActionProvider](/reference/android/support/v4/view/ActionProvider)\n - [AsyncLayoutInflater](/reference/android/support/v4/view/AsyncLayoutInflater)\n - [GestureDetectorCompat](/reference/android/support/v4/view/GestureDetectorCompat)\n - [GravityCompat](/reference/android/support/v4/view/GravityCompat)\n - [InputDeviceCompat](/reference/android/support/v4/view/InputDeviceCompat)\n - [LayoutInflaterCompat](/reference/android/support/v4/view/LayoutInflaterCompat)\n - [MarginLayoutParamsCompat](/reference/android/support/v4/view/MarginLayoutParamsCompat)\n - [MenuCompat](/reference/android/support/v4/view/MenuCompat)\n - [MenuItemCompat](/reference/android/support/v4/view/MenuItemCompat)\n - [MotionEventCompat](/reference/android/support/v4/view/MotionEventCompat)\n - [NestedScrollingChildHelper](/reference/android/support/v4/view/NestedScrollingChildHelper)\n - [NestedScrollingParentHelper](/reference/android/support/v4/view/NestedScrollingParentHelper)\n - [PagerAdapter](/reference/android/support/v4/view/PagerAdapter)\n - [PagerTabStrip](/reference/android/support/v4/view/PagerTabStrip)\n - [PagerTitleStrip](/reference/android/support/v4/view/PagerTitleStrip)\n - [PointerIconCompat](/reference/android/support/v4/view/PointerIconCompat)\n - [ScaleGestureDetectorCompat](/reference/android/support/v4/view/ScaleGestureDetectorCompat)\n - [VelocityTrackerCompat](/reference/android/support/v4/view/VelocityTrackerCompat)\n - [ViewCompat](/reference/android/support/v4/view/ViewCompat)\n - [ViewConfigurationCompat](/reference/android/support/v4/view/ViewConfigurationCompat)\n - [ViewGroupCompat](/reference/android/support/v4/view/ViewGroupCompat)\n - [ViewPager](/reference/android/support/v4/view/ViewPager)\n - [ViewPager.LayoutParams](/reference/android/support/v4/view/ViewPager.LayoutParams)\n - [ViewPager.SavedState](/reference/android/support/v4/view/ViewPager.SavedState)\n - [ViewPager.SimpleOnPageChangeListener](/reference/android/support/v4/view/ViewPager.SimpleOnPageChangeListener)\n - [ViewParentCompat](/reference/android/support/v4/view/ViewParentCompat)\n - [ViewPropertyAnimatorCompat](/reference/android/support/v4/view/ViewPropertyAnimatorCompat)\n - [ViewPropertyAnimatorListenerAdapter](/reference/android/support/v4/view/ViewPropertyAnimatorListenerAdapter)\n - [WindowCompat](/reference/android/support/v4/view/WindowCompat)\n - [WindowInsetsCompat](/reference/android/support/v4/view/WindowInsetsCompat)"]]