[android-developers] Re: Starting an activity with FLAG_ACTIVITY_MULTIPLE_TASK to see multiple instances

2009-02-02 Thread Dan Raaka

Here is an use case we are trying ..

Apk .. MyEmail
   main -> Inbox
   view -> composer
   view -> msgview

If the above apk contains 3 activities ..

User launches the "MyEmail: and sees the Inbox ..
User selects one of the messages .. thus launching the "msgview"
activity ..

User goes back to home .. and launches .. composer directly .. ()
Now the user must be able to switch back and forth between "msgview"
and "composer" .. Note this composer window has no association with
the Inbox->msgview ..

One possible method is to launch the MyEmail in own task and launch
another activity (eg.composer) as a separate instance .. This is what
I was trying to show in the code above ..

I did read through the 'warning' in the docs of
FLAG_ACTIVITY_MULTIPLE_TASK usage. Assuming for now we use the
RecentAppsDialog(long key press) as the task switcher .. any
suggestions ?

-Dan




On Feb 2, 12:23 pm, Dianne Hackborn  wrote:
> Please please please don't use FLAG_ACTIVITY_MULTIPLE_TASK unless you really
> know what you are doing.  At the very least, you need to read and fully
> understand the material here:
>
> http://code.google.com/android/intro/appmodel.html
>
>
>
> On Mon, Feb 2, 2009 at 12:11 PM, Dan Raaka  wrote:
>
> > I am trying to launch an activity from another activity ..
> > Within the com.android.SingleLauncher..
>
> > I have activity launch code as ..
>
> >                Intent intent = new Intent(Intent.ACTION_MAIN);
> >                intent.addCategory(Intent.CATEGORY_LAUNCHER);
> >                intent.setComponent(new
> > ComponentName("com.android.TargetSL",
> >                        "com.android.TargetSL.TargetSL"));
> >               intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
> > Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
>
> > I have set the android:multiprocess="true" in the AndroidManifest.xml
> > of TargetSL
> > I don't seem to see the multiple instances of TargetSL, which i am
> > expecting ..
>
> > All i see is 2 process, where i was hoping to see an instance of
> > TargetSL, for each launch that was invoked by the singleLauncher !!
>
> > # ps
> > ps
> > USER     PID   PPID  VSIZE RSS   WCHAN    PC         NAME
> > .a bunch of stuff ...
> > app_30   157   23    91484 12140  afe0c824 S
> > com.android.SingleLauncher
> > app_31   236   23    90452 11580  afe0c824 S
> > com.android.TargetSL
>
> > Am I missing something here ?
>
> > -Dan
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Starting an activity with FLAG_ACTIVITY_MULTIPLE_TASK to see multiple instances

2009-02-02 Thread Dianne Hackborn
Please please please don't use FLAG_ACTIVITY_MULTIPLE_TASK unless you really
know what you are doing.  At the very least, you need to read and fully
understand the material here:

http://code.google.com/android/intro/appmodel.html

On Mon, Feb 2, 2009 at 12:11 PM, Dan Raaka  wrote:

>
> I am trying to launch an activity from another activity ..
> Within the com.android.SingleLauncher..
>
> I have activity launch code as ..
>
>Intent intent = new Intent(Intent.ACTION_MAIN);
>intent.addCategory(Intent.CATEGORY_LAUNCHER);
>intent.setComponent(new
> ComponentName("com.android.TargetSL",
>"com.android.TargetSL.TargetSL"));
>   intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
> Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
>
> I have set the android:multiprocess="true" in the AndroidManifest.xml
> of TargetSL
> I don't seem to see the multiple instances of TargetSL, which i am
> expecting ..
>
> All i see is 2 process, where i was hoping to see an instance of
> TargetSL, for each launch that was invoked by the singleLauncher !!
>
> # ps
> ps
> USER PID   PPID  VSIZE RSS   WCHANPC NAME
> .a bunch of stuff ...
> app_30   157   2391484 12140  afe0c824 S
> com.android.SingleLauncher
> app_31   236   2390452 11580  afe0c824 S
> com.android.TargetSL
>
> Am I missing something here ?
>
> -Dan
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Starting an activity with FLAG_ACTIVITY_MULTIPLE_TASK

2008-12-02 Thread Dianne Hackborn
You need to at least post the stack crawl of the error.

On Tue, Dec 2, 2008 at 4:57 AM, RoadRunner.Android
<[EMAIL PROTECTED]>wrote:

>
> I am writing an application in which I want the activity to a new
> instance everytime it is executed, so I am applying
> FLAG_ACTIVITY_MULTIPLE_TASK in conjuction with FLAG_ACTIVITY_NEW_TASK
> in the Intent that triggers the activity. But I soon as I execute the
> application, I get an "Force Closed" dialog box. Can anyone help me
> out or tell a better way to achieve the required task?
>
> Thank-you very much.
>
>
> >
>


-- 
Dianne Hackborn
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 android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---