Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/view/LayoutInflater.Factory#pubmethods)

# LayoutInflater.Factory

*** ** * ** ***

` public static interface LayoutInflater.Factory `   
` `

|---|
| android.view.LayoutInflater.Factory |

Known indirect subclasses [AccountAuthenticatorActivity](https://developer.android.com/reference/android/accounts/AccountAuthenticatorActivity), [Activity](https://developer.android.com/reference/android/app/Activity), [ActivityGroup](https://developer.android.com/reference/android/app/ActivityGroup), [AliasActivity](https://developer.android.com/reference/android/app/AliasActivity), [ExpandableListActivity](https://developer.android.com/reference/android/app/ExpandableListActivity), [LauncherActivity](https://developer.android.com/reference/android/app/LauncherActivity), [LayoutInflater.Factory2](https://developer.android.com/reference/android/view/LayoutInflater.Factory2), [ListActivity](https://developer.android.com/reference/android/app/ListActivity), [NativeActivity](https://developer.android.com/reference/android/app/NativeActivity), [PreferenceActivity](https://developer.android.com/reference/android/preference/PreferenceActivity), [TabActivity](https://developer.android.com/reference/android/app/TabActivity) [AccountAuthenticatorActivity](https://developer.android.com/reference/android/accounts/AccountAuthenticatorActivity) *This class was deprecated in API level 30. Applications should extend Activity themselves. This class is not compatible with AppCompat, and the functionality it provides is not complex.* [Activity](https://developer.android.com/reference/android/app/Activity) An activity is a single, focused thing that the user can do. [ActivityGroup](https://developer.android.com/reference/android/app/ActivityGroup) *This class was deprecated in API level 13. Use the new `https://developer.android.com/reference/android/app/Fragment` and `https://developer.android.com/reference/android/app/FragmentManager` APIs instead; these are also available on older platforms through the Android compatibility package.* [AliasActivity](https://developer.android.com/reference/android/app/AliasActivity) *This class was deprecated in API level 30. Use `<activity-alias>` or subclass Activity directly.* [ExpandableListActivity](https://developer.android.com/reference/android/app/ExpandableListActivity) *This class was deprecated in API level 30. Use `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html` or use `https://developer.android.com/reference/android/widget/ExpandableListView` directly* [LauncherActivity](https://developer.android.com/reference/android/app/LauncherActivity) *This class was deprecated in API level 30. Applications can implement this UI themselves using `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html` and `https://developer.android.com/reference/android/content/pm/PackageManager#queryIntentActivities(android.content.Intent,%20int)`* [LayoutInflater.Factory2](https://developer.android.com/reference/android/view/LayoutInflater.Factory2) [ListActivity](https://developer.android.com/reference/android/app/ListActivity) *This class was deprecated in API level 30. Use `https://developer.android.com/reference/androidx/fragment/app/ListFragment.html` or `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html` to implement your Activity instead.* [NativeActivity](https://developer.android.com/reference/android/app/NativeActivity) Convenience for implementing an activity that will be implemented purely in native code. [PreferenceActivity](https://developer.android.com/reference/android/preference/PreferenceActivity) *This class was deprecated in API level 29. Use the [AndroidX](https://developer.android.com/jetpack/androidx) [Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on using the AndroidX Preference Library see [Settings](https://developer.android.com/guide/topics/ui/settings).* [TabActivity](https://developer.android.com/reference/android/app/TabActivity) *This class was deprecated in API level 13. New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the Fragment API that is compatible down to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#DONUT`.*   

*** ** * ** ***

## Summary

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/view/LayoutInflater.Factory#onCreateView(java.lang.String,%20android.content.Context,%20android.util.AttributeSet)(https://developer.android.com/reference/java/lang/String name, https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/util/AttributeSet attrs) ` Hook you can supply that is called when inflating from a LayoutInflater. |

## Public methods

### onCreateView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract View onCreateView (String name, 
                Context context, 
                AttributeSet attrs)
```

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.

Note that it is good practice to prefix these custom names with your package (i.e., com.coolcompany.apps) to avoid conflicts with system names.

<br />

| Parameters ||
|---|---|
| `name` | `String`: Tag name to be inflated. This value cannot be `null`. <br /> |
| `context` | `Context`: The context the view is being created in. This value cannot be `null`. <br /> |
| `attrs` | `AttributeSet`: Inflation attributes as specified in XML file. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | View Newly created view. Return null for the default behavior. <br /> |