PandoraMedia / BottomNavigator

Android Bottom Navigation multiple stack manager
Apache License 2.0
305 stars 22 forks source link

Handle process death. #1

Open guelo opened 5 years ago

guelo commented 5 years ago

Save BottomNavigator state in saveInstanceState.

davidbilik commented 5 years ago

What is the current behavior on process death? Default init settings? Isnt it a leak? Because fragments are still inside FragmentManager, arent they?

guelo commented 5 years ago

Yes it's a leak. BottomNavigator will create new fragments and ignore the existing ones inside FragmentManager.

guelo commented 5 years ago

Considered several solutions and decided that in the interest of keeping BottomNavigator's API small we'll use androidx's Lifecycle Viewmodel Savedstate when it becomes available. Unfortunately that library is at version 1.0.0-alpha03 and it requires activity:1.1.0-alpha02 and fragment:1.2.0-alpha02, which means that we'll force those requirements on users of the library.

guelo commented 5 years ago

Moved the memory leak bug to Issue #4. This ticket is for the enhancement to preserve BottomNavigator state after process death.