Retain the Fragment object while rotating
By default Android will retain the fragment objects. In your code you are setting the homeFragment in your onCreate function. That is why it is allways some homeFragment or fl what ever that you set in onCreate. Because whenever you rotate, the onCreate will execute and set your fragment object to the first one So … Read more