I want to know how to communicatate between fragments in two different activities, ive posted a snapshot below
Can someone show a sample program
are there any standard developers examples out there, if true please point me to that source any other online docs, blogs that explain this concept crisply
note :: i am aware of knowledge of communicating between two activities using intents when fragments are not involved
A fragment class inside an activity is usually public static. That's why its possible to launch the fragment from another activity.
FragmentTransaction transaction = getFragmentManager().beginTransaction();
// Replace whatever is in the fragment_container view with this fragment,
// and add the transaction to the back stack
transaction.replace(R.id.fragment_container, newFragment);
transaction.addToBackStack(null);
// Commit the transaction
transaction.commit();
you have fragment 1 and if u want to open the fragment 2 means
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.