I have a FragmentActivity in which I am displaying two Fragments, Fragment A and Fragment B. In Fragment A I have another Fragment with Tabs. I have done this using classic TabHost. In this TabHost I have 2 more Fragments which has a ListView. Now what I want is on clicking on listitem I want to replace the content in Fragment B of parent FragmentActivity. Please help me to achieve this. I have tried the following till now.
1. View mContainer = (View)getActivity().findViewById(R.id.rightpane);
2. ViewGroup mContainer = (ViewGroup)getView().getParent();
3. Activity rrlist = ((RRPatientList)getParentFragment()).getActivity().getParent();
View mContainer = (View) rrlist.findViewById(R.id.rightpane);
ResultDetailView rdl = new ResultDetailView();
rdl.setArguments(args);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(mContainer.getId(), rdl);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.addToBackStack(null);
ft.commit();
Nothing is working and I am getting either NullPointerException or No View Found for the ID ****** errors.
Please refer the screen shot for more info.
