Skip to content

Most visited

Recently visited

navigation

LayoutInflaterCompat

public final class LayoutInflaterCompat
extends Object

java.lang.Object
   ↳ android.support.v4.view.LayoutInflaterCompat


Helper for accessing features in LayoutInflater introduced after API level 4 in a backwards compatible fashion.

Summary

Public methods

static LayoutInflaterFactory getFactory(LayoutInflater inflater)

This method was deprecated in API level 26.0.0-alpha1. Use setFactory2(LayoutInflater, LayoutInflater.Factory2) to set and getFactory2() to get the factory.

static void setFactory(LayoutInflater inflater, LayoutInflaterFactory factory)

This method was deprecated in API level 26.0.0-alpha1. Use setFactory2(LayoutInflater, LayoutInflater.Factory2) instead to set and getFactory2() to get the factory.

static void setFactory2(LayoutInflater inflater, LayoutInflater.Factory2 factory)

Attach a custom LayoutInflater.Factory2 for creating views while using this LayoutInflater.

Inherited methods

From class java.lang.Object

Public methods

getFactory

added in version 23.2.0
LayoutInflaterFactory getFactory (LayoutInflater inflater)

This method was deprecated in API level 26.0.0-alpha1.
Use setFactory2(LayoutInflater, LayoutInflater.Factory2) to set and getFactory2() to get the factory.

Return the current LayoutInflaterFactory (or null). This is called on each element name. If the factory returns a View, add that to the hierarchy. If it returns null, proceed to call onCreateView(name).

Parameters
inflater LayoutInflater

Returns
LayoutInflaterFactory The LayoutInflaterFactory associated with the LayoutInflater. Will be null if the inflater does not have a LayoutInflaterFactory but a raw LayoutInflater.Factory.

See also:

setFactory

added in version 22.1.0
void setFactory (LayoutInflater inflater, 
                LayoutInflaterFactory factory)

This method was deprecated in API level 26.0.0-alpha1.
Use setFactory2(LayoutInflater, LayoutInflater.Factory2) instead to set and getFactory2() to get the factory.

Attach a custom Factory interface for creating views while using this LayoutInflater. This must not be null, and can only be set once; after setting, you can not change the factory.

Parameters
inflater LayoutInflater

factory LayoutInflaterFactory

See also:

setFactory2

void setFactory2 (LayoutInflater inflater, 
                LayoutInflater.Factory2 factory)

Attach a custom LayoutInflater.Factory2 for creating views while using this LayoutInflater. This must not be null, and can only be set once; after setting, you can not change the factory.

Parameters
inflater LayoutInflater

factory LayoutInflater.Factory2

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.