0

Similiar to this this issue, i was trying to access and manipulate a second fragment that was created in the first fragment, before i realized that the nullpointerException is most probably caused by the nonready state of the second fragment. So is this generally not possible and i have to do something like passing a bundle with the data?

That works:

MyMap mapFragment = new MyMap(); getActivity().getSupportFragmentManager().beginTransaction() .add(R.id.frame,mapFragment,"map") .commit();

but this gives me a null reference:

MyMap mapFragment = (MyMap)getActivity().getSupportFragmentManager().findFragmentById(R.id.map);

Community
  • 1
  • 1
Reinmarius
  • 114
  • 11

0 Answers0