how android layout inflate mechanism working in fr

2019-08-03 22:50发布

问题:

I am a beginner about android. For the past 6 months, I have been using the following code to display the layout in listview, fragment and add custom header.

(ViewGroup) inflater.inflate(layout,view, false);

LayoutInflater.from(getActivity()).inflate(layout, null);

But i do not understand the functionality, and what it describes, and how it is working. Please kindly explain those if you know. Sorry for my bad English.

回答1:

I will strongly recommend reading this article

  • Layout inflation as intended


as it is veryinteresting and covers basic stuff and also some common mistakes.