Hi,
Is there a generic android way of pooling objects ? I typically tend to
reuse objects by avoiding threads and ensuring the access pattern is
synchronous, but in some cases its totally unavoidable, for example in a
Service implementation all methods I have to pass a bulky object as
Message.obj from service to handler.
class BulkyObject {
}
class MyBinder extends MyBinder.Stub {
public void doOne() {
BulkyObject b1 = new BulkyObject();
b1.setStuff();
sendMessageToHandler(Message.obtain(ACTION, b1));
}
public void doTwo() {
BulkyObject b2 = new BulkyObject();
b2.setStuff();
sendMessageToHandler(Message.obtain(ACTION, b2));
}
}
In this case a lot of new Bulkyobjects are wasted. Any ideas ?
regards,
harsh
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---