1.
Excerpt from: http://www.cnblogs.com/top5/archive/2012/05/04/2482328.html
In actual development layoutinflater its function is similar to Findviewbyid (). The difference is that Layoutinflater is used to find the XML layout file under res/layout/and is instantiated, while Findviewbyid () is looking for specific widget controls (such as button, TextView, and so on) under the XML layout file.
Specific role: 1, for a non-loaded or want to dynamically load the interface, you need to use Layoutinflater.inflate () to load, 2, for an already loaded interface, you can use Activiyt.findviewbyid () method to obtain the interface elements. Layoutinflater is an abstract class that is declared in the document as follows: Public abstract class Layoutinflater extends object obtains three ways of Layoutinflater instance 1. Layoutinflater inflater = Getlayoutinflater ();//Invoke Activity's Getlayoutinflater () 2. Layoutinflater Inflater = layoutinflater.from (context); 3. Layoutinflater Inflater = (layoutinflater) context.getsystemservice (Context.layout_inflat Er_service);
Android Layoutinflater use