How to set Different String in a Textview in Fragment while clicking different Button?
问题 I'm new to Android app programming. I have two Fragments - fragmentA.xml and fragmentB.xml . In fragmentA there are two Buttons - Button One (id: btnOne ) and Button Two (id: btnTwo ). In fragmentB there is TextView (id- textView ) In fragmentB java class there are two String - string1 and string2 Both buttons refers to fragmentB . I want two set the textView text to string1 when I press Button One and string2 when I press Button Two. How can I do that? I was using following code in fragmentB