5

Possible Duplicate:
What does Layout Inflater in Android do?

What is the layout inflater used for in an Android application?

Community
  • 1
  • 1
Tushar
  • 5,907
  • 15
  • 49
  • 81
  • 1
    -1 Sorry but yet another down-vote for you. Please try to find answers to general problems yourself by either goggling or searching on StackOverflow before asking such questions. Again if You encounter a problem with the layout inflater or you've even read about it and still don't get how to use it then ask but this is unfriendly and not helping you. Try to take a look at http://developer.android.com and read the principles. – Octavian Helm Oct 18 '10 at 12:06
  • 6
    @octavian - your comment is not helpful. Either attempt to answer the question and gain rep and point the OP in the right direction or flag the post if you think it's so awful. Ranting away in the comments isn't encouraged and never adds anything of value. We're not /. – Kev Oct 18 '10 at 12:17
  • @Kev: I'm sorry. I was just a bit frustrated because it is the second time he does exactly the same thing without taking the feedback someone gave him. – Octavian Helm Oct 18 '10 at 13:02
  • @octavian - as a long time user of SO I know and I understand your frustrations and it saddens me when I look at the SO front page some days. But if you flag and let the mods know (there is a drive to clean up low quality questions and discourage repeat offenders) it keeps the site free of this kind of chatter which detracts from the purpose of the site - a place for high quality Q&A. See http://blog.stackoverflow.com/2010/10/asking-better-questions/ and http://meta.stackexchange.com/questions/56817 – Kev Oct 18 '10 at 13:14
  • @Kev: Yes I see. I've done that and will keep that in mind. Thanks. – Octavian Helm Oct 18 '10 at 13:16
  • Possible duplicate: http://stackoverflow.com/q/3477422/2291 – Jon Adams Oct 10 '12 at 13:58

3 Answers3

20

Basically it is needed to create (or fill) View based on XML file in runtime. For example if you need to generate views dynamically for your ListView items.

cement
  • 2,905
  • 1
  • 23
  • 20
6

LayoutInflater is used instantiate XMLs that create Views. This involves parsing the XML, creating the View object, and finally adding it to the View hierarchy.

Check out the Android API for more information about it.

Tyler Treat
  • 14,640
  • 15
  • 80
  • 115
1

Uhm, LayoutInflater?

Felix
  • 88,392
  • 43
  • 149
  • 167