According to this issue in the English OS you need to serialize objects because they are passed to a class called ActivityManagerNative
which is in a process separate from other applications.
When two distinct processes want to communicate the memory is not shared and therefore it is not possible to pass from one to the other the same object.
But the answer does not enter into the merit of why the communication was designed to work like this.
The most likely explanation is that the mechanism of communication by Intent
's Android was designed to work both between components (Activities
, Services
, etc.) of the same process (application) as between components of different processes (of a Activity
from application A to Activity
application B, for example).
That is, serialization is necessary to allow data transfer via IPC
(Inter-process communication).
Between two Activities
of the same process it is possible to communicate without serializing the object, just do not use the mechanism of Intents
and instead use a shared resource (a global static object or inherited by both Activities
, or a Singleton).
Related: http://answall.com/q/38492/4808
– Renan Gomes