0

I need to change my fragment, but when i do changeFragment i got that exception:

java.lang.RuntimeException: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

my code:

 ((MainActivity) getActivity()).changeFragment(new HomeFragment(), 
 HomeFragment.TAG);

im doing something wrong?

Flávio Costa
  • 895
  • 5
  • 18
  • 41

0 Answers0