Closed alahammad closed 6 years ago
Hi, Could you provide more details ... In general, selectedAbsolutePosition is -1 if no selected segment is selected.
SecmetedControl is in FragmentA , from FragmentA we open FragmentB, and when we come back to FragmentA the segmentedControl.getSelectedAbsolutePosition() returns -1. Is this the case ?
yes this is the issue when back to fragment
Hi, Most probable you replace the FragmentA with FragmentB instead of adding FragmentB on FragmentA. After navigating back to FragmentA, it will be recreated ... That is why segmented control's absolute position is -1. Could you provide fragment transaction code snippet for navigating from FragmentA to FragmentB ?
By the way here is the working example with specified scenario SegmentedControllSupport.zip
Hi,
Actually I use the new navigation component in jetpack, so i think it's replace fragment with another.
Yes... exactly, It's makes fragment replacement instead of adding them to one on another...
Hello,
I face issue when i back to fragment the state of selectedAbsolutePosition is set to -1.
Is there any solution for this case..
Thanks,