[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-31 Thread codethief
Hello Oceanedge, I'd like to get back to one of your former questions: Thanks, but I think singleton is a general pattern used generally. Why should we stop using it in Android? :( http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-27 Thread Oceanedge
Thank your very much! BlablaManager actually handles the image editing session information. One task shall have only one session. I understand your point. Now I quit using singleton stead using a static field of the main activity to reference the instance of BlablaManager, and then any other

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Oceanedge
Sorry, there are three separate applications. One is my Photo Editor application. The other two applications are the launcher applications, they emit android.intent.action.EDIT intent to launch my Photo Editor application. The Photo Editor application contains my photo editor activity which

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Oceanedge
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 romain...@google.com wrote: Hi, You cannot do this, if only for security reasons. Running arbitrary code in the Home process would be very bad :)

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Romain Guy
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 newsforhar...@gmail.com wrote: Thanks, but I think singleton is a

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Oceanedge
Yeah, but I think my singleton class can works well with the OS handle Task as a single process. But in Android, Task can be cross linux process. So my two activity instances are created by two tasks. But they are all created within one Dalvik VM linux process, and Dalvik VM didn't distinguishes

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Dianne Hackborn
On Tue, May 26, 2009 at 7:11 PM, Oceanedge newsforhar...@gmail.com wrote: Yeah, but I think my singleton class can works well with the OS handle Task as a single process. But in Android, Task can be cross linux process. So my two activity instances are created by two tasks. Because you have

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-25 Thread Romain Guy
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

[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-25 Thread Matt Williams
I was a bit confused by your question. Are they 2 applications, or 2 activities within the same application? If they are activities within the same application, could you use the Application context to synchronize access to the singleton? On May 26, 5:06 am, Oceanedge newsforhar...@gmail.com