You should always add, remove and replace your fragments problematically. As such I suggest you replace your “LoginFragment” fragments with containers such as FrameLayout. Apparently, I had to use android.support.v4.app.Fragment; instead of android.app.Fragment;. This is the code I got it to work with:

setFragment method called from displayView method,

And to set it (from the nav bar onNavigationItemSelected(), you do this:

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.