How to work with LayoutInflater in Kotlin

How to work with LayoutInflater in Kotlin
December 19, 2018 2 Comments Development Pushpendra Kumar

Typically, you don’t ever need to directly use a LayoutInflater. Android does most of the layout inflation for you when you call setContentView() in the onCreate() method of your activity. So you, as the programmer, are responsible for making sure the views are inflated. Now you want to inflate views in the context of a ListView. The Adapter class can do the inflation for you if you do not want to customize each item. But if you want to customize the views shown in a list, you will have to manually inflate each view with the LayoutInflater, since there is no other existing method you can use. But if you are here then in very simple way we can use like below code.

Wish you good luck 🙂 Happy Coding

About The Author
Pushpendra Kumar I am passionate about mobile application development and professional developer at Colour Moon Technologies Pvt Ltd ( This website I have made so that I can meet with new challenges and can share here.
Leave Comment
  1. 1


    Ԛuaⅼitʏ artiⅽles is the key to attract the users to pаy a visit
    the site, that’s what this site iѕ providing.

  2. 1


    The short answer is the lack of lambdas and functional operations. But Kotlin can work with them, so sorting, transforming, mapping or filtering are just a function call away.


Leave a reply

Your email address will not be published. Required fields are marked *