private void switchFragment(Fragment fragment) {
if (getActivity() == null)
return;
ClassA pm = (ClassA) getActivity();
pm.switchContent(fragment);
}
I am trying to switch fragments from ClassB, i am getting this exception when i try to do. I am trying to call the fragments of Class A Activity.
java.lang.ClassCastException: com.test.ClassB cannot be cast to com.test.ClassA