Hi , Thanks for your reply..

 I have my HTTP server(Apache CORE) running a service S. While I receive a 
POST request, the response should be sent after execution of an intent A, 
which sends a Broadcast to my service S already running (which is designed 
based on my requirement). So I need to handle the HTTP POST response in the 
Broadcast receiver. Is this possible to do? So, I need the HttpResponse in 
the handle() method to be sent in the Broadcast receiver and send the 
response from there. Please let me know if you need more details. 

Thanks!

On Sunday, January 20, 2013 10:26:00 PM UTC+2, Kristopher Micinski wrote:
>
> 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] <javascript:>> 
> 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]<javascript:> 
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:> 
> > 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

Reply via email to