The singleton is a perfectly valid pattern with Android, but if you need to use two instances of your "singleton," then the problem is that you are using a singleton in the first place.
On Tue, May 26, 2009 at 12:58 AM, Oceanedge <[email protected]> wrote: > > Thanks, but I think singleton is a general pattern used generally. Why > should we stop using it in Android? :( > > On May 26, 12:12 pm, Romain Guy <[email protected]> wrote: >> Hi, >> >> You cannot do this, if only for security reasons. Running arbitrary >> code in the Home process would be very bad :) >> >> Instead of creating two processes (which is really heavy and requires >> a lot more memory), why don't you stop using a singleton? >> >> >> >> On Mon, May 25, 2009 at 9:06 PM, Oceanedge <[email protected]> wrote: >> >> > I'm developing a photo editor application. It will launched by >> > android.intent.action.EDIT intent. I made two application to emit that >> > intent. I found that two instance of my photo editor activity is >> > created within the same process which is named as my activity. But >> > there is a singleton class used in my photo editor activity and that >> > two activities use the same singleton class instance which break my >> > application logic. >> > I wonder if there is any way to let Android create my activity within >> > the process which the launcher activity lies in? So that the two >> > instance of my photo editor activity can be separated into two >> > different process. And so they can reference to different instance of >> > that singleton class. >> > Thanks! >> >> -- >> Romain Guy >> Android framework engineer >> [email protected] >> >> Note: please don't send private questions to me, as I don't have time >> to provide private support. All such questions should be posted on >> public forums, where I and others can see and answer them > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

