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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -