Delete the default ‘Hello World’ TextView in activity_main.xml.Do not bother much if you do not know Kotlin. What we want is that when an item is clicked, we get the item’s model(User) information and may be pass it to a second activity.įrom Android Studio, create an empty android project(Select the Kotlin support option) and name your activity, MainActivity.There is a Recyclerview adapter with a Recyclerview with a list of items(Users in this case).In this article, I will show you how to do it in a proper way using an example scenario. Some Android developers wonder why Google created a view like Recyclerview without a click listener(given the fact that the deprecated ListView has an item click listener).īecause there is no standard way of setting a click listener, new developers tend to confuse on the right way of doing it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |