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
  • 745
  • 3
  • 15
  • 37

0 Answers0