G
G
Good Samaritan2019-02-13 21:38:52
Android
Good Samaritan, 2019-02-13 21:38:52

Am I speaking correctly?

The essence of my misunderstanding lies in the method

@Override
    public void onSaveInstanceState(Bundle outState) {
        outState.putInt("seconds",seconds);
        outState.putBoolean("running",running);
}

The explanation says that before the "death" of the activity, this method is called.
I understand that it is called by the android(?) itself, since it is not called anywhere in the activity code.
And it seems to me that before the "death" of the activity, the following happens
.....
Bundle bundle=new Bundle()
onSaveInstanceState(bundle);
.....

Correct me if I'm wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2019-02-13
@djamali

Yes, the method is called by the system, in much the same way as you described. The bundle can be serialized, and the system unloads it outside in case the process dies, in order to restore the state of the activity later.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question