In a nutshell, this class is used to inflate the XML data that defines Views and ViewGroups. Inflation is a process that includes: analysis of layout XML-layouts, creation of corresponding View objects and their addition to the presentation hierarchy.
This is used to instantiate the XML layout file into the corresponding View objects. It is never used directly - use getLayoutInflater () or getSystemService (String) to get a standard instance of LayoutInflater that is already connected to the current context and correctly configured for the device you are working on. For instance:
LayoutInflater inflater = (LayoutInflater)context.getSystemService (Context.LAYOUT_INFLATER_SERVICE);
Learn more about this here. Android Layout Resources
source share