R
R
Ryabos2019-09-01 07:22:30
Android
Ryabos, 2019-09-01 07:22:30

How was the state of the fragments preserved before the advent of the ViewModel and LiveData?

The official guide for the ViewModel gives this example: an activity, in it a fragment with a list, and another fragment to display the element that is selected in the list.
How to support screen rotation without using ViewModel and LiveData? Those. How was it before 2017?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2019-09-01
@Ryabos

Just as it is done now where these components are not used.
onSaveInstanceState/onRestoreInstanceState +Icepick, retain fragment, not killing activity when changing configuration + onConfigurationChanged, replacing fragments with controllers (Conductor).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question