2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

For #4652: HomeFragment Crash "Can not.. after onSaveInstanceState"

This commit is contained in:
Colin Lee 2019-08-12 13:02:35 -05:00 committed by Emily Kager
parent 337ad1e88e
commit 0c8bcd39be

View File

@ -24,6 +24,7 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.Observer
import androidx.lifecycle.OnLifecycleEvent
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.FragmentNavigator
import androidx.navigation.fragment.NavHostFragment.findNavController
@ -677,7 +678,9 @@ class HomeFragment : Fragment(), AccountObserver {
val tabs = getListOfSessions().toTabs()
val viewModel: CreateCollectionViewModel by activityViewModels()
val viewModel: CreateCollectionViewModel by activityViewModels {
ViewModelProvider.NewInstanceFactory() // this is a workaround for #4652
}
viewModel.tabs = tabs
val selectedTabs =
tabs.find { tab -> tab.sessionId == selectedTabId }