Are additional intentions provided in the parcel, even if a new activity begins as part of the same task?

It was interesting to me...

So, if you start a new action using an intent, the intent must be serialized and deserialized, because you may need to send the intent to a single instance of the virtual machine via IPC. But what if the PackageManager knows that your new action will be created in the current task? It seems that Googly's reasonable optimization would not consist in serializing the intent at all, since all this happens inside the same virtual machine. But again, you cannot just let the new activity use the same instance of each argument, because any changes made by the new action will be displayed in the old activity, and the programmer may not expect this.

So, is this optimization performed? Or are all the add-ons always sorted and not sorted, no matter what?

+3
source share
1 answer

A small experiment gave an unexpected result: if you add Parcelableto your intention, it is really configured, even if you do not leave the current virtual machine.

It’s so good that you mentioned optimization, otherwise I would argue that people would already abuse it :-)

+1
source

Source: https://habr.com/ru/post/1737373/


All Articles