Layoutinflater is used to import the interface. To put it bluntly, it is used to find and import the. XML interface in layout. As follows:
Public class mainactiti1_extends acticity {
Textview;
Public void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
// Setcontentview (R. layout. activity_main );
Textview = (textview) findviewbyid (R. Id. textview );
Layoutinflater = layoutinflater. From (this );
View view = layoutinflater. Inflate (R. layout. activity_main, null );
Setcontentview (View );
}
}
In the above class, setcontentview (R. layout. activity_main) can be
Layoutinflater = layoutinflater. From (this );
View view = layoutinflater. Inflate (R. layout. activity_main, null );
Setcontentview (View );
Instead, layoutinflater is fully available if you want to import a new interface.
Role of layoutinflater