Ayden
10/18/2020, 3:52 AMonClickListener
, itemClicklLisntener
in my MainActivity.kt
which will response to user onClick activity.
Question
But why the view model does not display the value on the fragment?
MainActivity - <https://pastebin.com/4Zp492kn>
QuoteAdapter - <https://pastebin.com/WGSVdh6H>
QuoteViewModel - <https://pastebin.com/X6mv0pH7>
QuoteFragmentLayout -<https://pastebin.com/U4Qcm902>
Iqbal Ahmed
10/18/2020, 5:20 AMAyden
10/18/2020, 6:14 AMIqbal Ahmed
10/18/2020, 6:41 AMQuoteFragment
and I don't understand this why are you doing this
private fun itemClickListener(quote: Quote) {
quoteViewModel.quote.value = quote.quote
quoteViewModel.author.value = quote.author
Iqbal Ahmed
10/18/2020, 6:41 AMQuoteFragment
right?Iqbal Ahmed
10/18/2020, 6:43 AMfragmentBinding.arguments = Bundle().apply{
put(key,value)
}
to pass value to QuoteFragment
Ayden
10/18/2020, 6:53 AM