You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
davnil74 edited this page May 8, 2012
·
1 revision
Passing data between activities
Passing data between activities is quite easy. You would normally do that using the Bundle packed into an intent. But sometimes you need to pass complex objects from one activity to another. To pass such objects directly through the Bundle, your class would need to implement the Parcelable interface.
- Why don´t you just pass a Serializable as a parameter?
Well, Serializable also helps, but it's too slow as compared to Parcelable. In Android parlance, I assume that your objects that you would need to pass between Activities would not be super complex.
Implementation-wise, Serializable seems to be a lot simpler, but if you consider the performace, Parcelable wins here.