Let's consider a case where I have Fragment A
and Fragment B
.
B
declares:
public interface MyInterface {
public void onTrigger(int position);
}
A
implements this interface.
When pushing Fragment B
into stack, how should I pass reference of Fragment A
for it in Bundle
so A
can get the onTrigger
callback when needed.
My use case scenario is that A
has ListView
with items and B
has ViewPager
with items. Both contain same items and when user goes from B -> A
before popping B
it should trigger the callback for A
to update it's ListView
position to match with B
pager position.
Thanks.