![]() Follow the on-screen instructions on your new Android phone. the function defined inside viewholder would look like fun setclicklistener(author: string, description: string) = itemimage. Turn on your new and existing Android phones. ![]() Once it has implemented that interface, you could do anything you want in the method it overrides. The idea is basically to define an interface inside a given fragment A and let the activity implement that interface. Although the way you are doing this is not the optimal way but if you want to continue then you can do the following.įirst instead of registering the click listener in init block you should define a function and then pass the values of author and description to that function. The easiest way to communicate between your activity and fragments is using interfaces. There is a new and better way to share data between activities, and it is LiveData.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |