Anything you can serialize you can pass, but excessive passing of references is an indicator of Android code smell.
In this case, I'd say your code smells because you want to pass an HttpResponse. This indicates to me that you are handling it somewhere on the GUI thread: which is bad. Instead you should do something like: - Handle the HttpResponse in a Service. - Talk to the service using some sort of AIDL or Messenger, etc.. - Pass an ID to another activity which identifies the object to the service or something. If you are passing a connection, you can store it in the application Context. I believe it's been mentioned multiple times that this is one of the use cases of the Application context, even though to me I feel like delegating through a Service seems more kosher. (But really, it's also a pain..) Kris On Sun, Jan 20, 2013 at 2:31 PM, a <[email protected]> wrote: > Thanks for the links. I saw the example of passing the object with String > and Int types. Can I also similarly pass a HttpResponse object to an > intent? > > > On Friday, January 18, 2013 5:09:16 PM UTC+2, skink wrote: >> >> >> >> a wrote: >> > Hi, >> > >> > is it possible to pass an object as intent extra in Android? I tried >> > with >> > my class implementing Parcelable and getting a ClassCastException. Can >> > anyone help with an example link? >> > >> > Thanks >> >> here you have an example link showing MyParcelable implementation; >> >> http://developer.android.com/reference/android/os/Parcelable.html >> >> pskink > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

