Reputation: 419
I launch fragment transition:
Fragment fragment = new InstalacionesEncontradasFragment();
Bundle bundle = new Bundle();
bundle.putSerializable("key", this.instalacionesConCategorias);
fragment.setArguments(bundle);
FragmentManager fragmentManager = getFragmentManager();
InstalacionesEncontradasFragment
FragmentTransaction mFragmentTransaction = fragmentManager.beginTransaction();
mFragmentTransaction.addToBackStack(null);
mFragmentTransaction.replace(R.id.main_frame_container, fragment, "ACTIVIDADES").commit();
The second Fragment get de object as:
Bundle bundle = this.getArguments();
instalacionesConCategorias = (ArrayList<Instalacion>) getArguments().getSerializable("key");
But now i want get "ACTIVIDADES" tag. Because, I want to know which of the fragments launched the current fragment
Upvotes: 0
Views: 70
Reputation: 1428
You could use different tags from different parents(I assume you do). And then in the child fragment you could call: this.getTag();
Upvotes: 1