android - referencing a textview in a fragment gives a null value -
i have 2 xml files, 1 containing recyclerview(main_fragment.xml) , containing items render on recyclerview(main_item.xml). fragment(mainfragment.java) extends fragment. main_item contains textview. in mainfragment.java inflating main_fragment.xml. want reference textview in main_item.xml listen click. null pointer. because in mainfragment.java inflating main_fragment.xml , not main_item.xml. pls should should setup onclicklistener textview in main_item.xml. thanks
this needs done in recyclerview.adapter , more in viewholder of adapter.
there many post on that. recyclerview onclick
Comments
Post a Comment