Skip to content

Multiple requests occur after configuration changes (rotate device) #49

@davekaro

Description

@davekaro

I have my own Turbo Native android app, that I was using the ViewFlipper for to handle bottom tab navigation. However, I noticed the same issues you brought up in #12. I saw your new implementation using supportFragmentManager and tried to implement in my app as well, but I discovered a new issue. I decided to run black candy locally to see if the same issue exists and it did. Here is what I am seeing:

  1. Launch the app and sign in
  2. Click the Library tab, observe the Rails logs show a single request to /library
  3. Rotate the device (I'm using the emulator)
  4. Observe the Rails logs now show a request for / and /library
  5. Rotate the device again
  6. Observe multiple requests to /library - each subsequent device rotation will increase the number of requests to /library every time.

I was able to debug to the point where I saw that in the MainActivity the libraryNavFragment is coming back as null after a device rotation, and therefore we call delegate.registerNavHostFragment(R.id.library_container) again, but the old "nav host fragment" must still be hanging around and executed somehow. I don't understand enough about Android and Turbo Native to have any good solutions. Do you have any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions