Hi, I'm trying to avoid recreating an object for each time I want to
send a message, but for some reason, only old data gets sent unless I
create a new object each time.
I've declared an Object array of the size I need inside my class and
then set the variables passed to my method to each index and then call
Message.obtain(myHandler, 0, myObjectArr).sendToTarget(). When I reuse
the object, most messages get dropped and I see the last message send
in their place instead.
But when I use Message.obtain(myHandler, 0, new Object[] { val1,
val2}).sendToTarget(), I always receive the data intact. I think this
might be caused by the same issue that caused my Bundles to get lost
(posted about it before).
Any ideas what would cause this? It's really frustrating that I have
to create a new Object each time. Given that loads of message will be
sent, it's not that really efficient.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---