there are 2 activity A and Screen in A Activity , i made handler and want to pass it to screen activity
Handler error_handler = new Handler() {
public void handleMessage(Message msg) {
}};
Intent loginButton_intent = new Intent(A.this, Screen.class);
loginButton_intent.putExtra("URL", URL);
loginButton_intent.putExtra("IP_Addres", dvr_login_data.IP_Addres);
loginButton_intent.("HAND", error_handler); <- but this code is error
how can i pass handler ? plz warm-answer
still looking for an answer? I had the same problem and found this question through google, so others might show up as well.
Anyways, I found my solution to the problem of using a handler between a service and an activity in the Android documentation. Just look at the Remote Messenger Service Sample right here: Remote Messenger Service Sample
Basically they are using a messenger as client interface for a local handler in the service.
Regards, Michael
Well, to keep it short, you can't...Handler
implements neithor Serializable
nor Parcelable
so it cannot be put as an extra
...The Object Transported using Intents must follow eithor of those protocols.
Speculation
I suppose, there's an alternative that would involve creating a Service
to act as a middle man. But that'll require some testing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With