Take a look at the docs for startActivityForResult:
http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,
int)

This mentions a specific case with the singleTask launch mode that seems to
be exactly what you are experiencing.  My guess is that since singleTask and
singleInstance are so similar they are behaving the same way.

Note the description of launch modes here:
http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

In general it is not recommended to use singleTask or singleInstance except
in very specialized circumstances.  Also note that it says singleInstance is
the same as singleTask except for an additional constraint.
<http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,
int)>
Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Fri, May 13, 2011 at 9:49 AM, Wall-E <[email protected]> wrote:

> Hey Nicholas,
>
> The launch mode for some of my Activities are "SingleInstance".
>
> My Activities are my own, custom activities.  They are being called
> like this:
>
> Intent intent = new Intent(CallingActivity.this,
> SetResultActivity.class);
> startActivityForResult(intent);
>
> The result code is RESULT_CANCELED or 0.
>
> I have been reading some other posts about this and some people
> mentioned seeing a "Activity is launching as a new task, so cancelling
> activity result..." message in the LogCat.
>
> Dianne Hackborn said this on a post:
>
> "The action or category (or data or mime type) in the launching
> intent
> doesn't matter at all for what will happen with the result. "
>
> So I don't know if the launch mode has anything to do with it but it
> seems like it does because it's saying it's cancelling it because it's
> a new task.
>
> On May 13, 11:37 am, Nicholas Johnson <[email protected]> wrote:
> > Also, what type of activities are you launching? That is, are you opening
> a
> > web browser, or are these activities that you implemented?
> >
> > And, what result code is returned in onActivityResult? Is it
> > RESULT_CANCELED?
> >
> > Nick
>
> --
> 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
>

-- 
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

Reply via email to