Android TutorialsNo Comments

642 views.

Many apps need to display user-interface elements based on large data sets, or data that frequently changes. For example, a music app might need to display information about thousands of albums, but only a dozen of those albums might be on-screen at a time. If the app created UI widgets for each of those albums, the app would end up using a lot of memory and storage, potentially making the app slow and crash-prone. On the other hand, if the app created UI widgets each time a new album scrolled onto the screen and destroyed the widgets when it scrolled off, that would also cause the app to run slowly, since creating UI objects is a resource-intensive operation for more details refer here

will see now one sample example

First, you can below dependency in gradle

activity_main.xml

Add recycler view to xml file

MainActivity.java

 

RecyclerAdapter.java

custom.xml

Output:

Screenshot_1514283173

Be the first to post a comment.

Add a comment