Recyclerview in Android Using Kotlin

63 views.

RecyclerView is used to load views to the activity when you don’t know how many views we need, or have a large number of individual item views to display in one activity. It saves memory by reusing views when you scroll in an activity instead of creating them all at the beginning when the activity first loads.

Loading all views at the beginning wastes memory since there will be many views loaded that cannot be seen on the screen. When developing an app, you always want to be aware of the memory cost of the features in your app. Android devices have limited memory, and your app will not be the only one running on a user’s device

activity_main.xml

MainActivity.kt

RecAdp.kt

custom.xml

Output

 

 

You may also like...

Leave a Reply