Parcelable Efficiency for inproc communication

I want to transfer a huge object (for example Bitmap) from one action to another inside one process. If I put it in Bundlelike Parcelable, does Android really serialize the object or pass it by reference?

+3
source share
1 answer

Android uses the Parcelable object when it transfers information from one process to another. In this case, first analyze the object for primitives, and then send them to the remote process. Since (usually) two actions of the same application work in the same process, there is no need to parse the object. Here I found that in your case a weak link to your object will be created and it will be passed to the second action. If you have actions in different processes (for example, in different applications), your object will be parsed and sent to the second process (in which case it will be sent by values, I think).

0
source

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


All Articles