There is activity , in it ViewPager and FloatingActionButton . I get a link to the fab in fragments of the view pager and put on it onClickListener , each fragment contains a unique id that needs to be processed in onClickListener . The problem is that in the handler, the id value is always null , although the fragment onCreate assigned a value and shows everything in the logs. I tried different options, and always the null variable in the handler. The fact is that a static variable cannot be made because the logic breaks, and the FloatingActionButton cannot be placed in fragments; it must be active. Is there a way out in this situation?
|
fab? - Jarvis_J