0

Tabbed activity layout <---> fragment communication

In Android studio, for tabbed activity, is there any way to add different apps to the tabs? I couldn't succeed to communicate with the buttons in layout by fragments' kotlin files... For example there is a fragment with parrented pages as 'tab1.kt' and 'tab1_layout.xml' In that layout page made some buttons named 'btn0' 'btn1' and 'btn2'; i wrote 'btnClickAdd' to the 'onClick' setting. In the next step i wrote a method as 'fun btnClickAdd(view:View){...}' and '...' Contains some codes with 'when' loop to add some texts to the 'textView' in layout page as long as presed the buttons... But it doesn't work! When i pressed one of the buttons app crashes... Because it says "button couldn't find the method i wrote to the 'onClick' setting" What should i do???

29th May 2019, 7:50 PM
Ugur Serhat Toy
Ugur Serhat Toy - avatar
0 Answer