I think there is a startActivity method in the Context class and
that's why
I got a bit confused regarding the startActivityForResult - I think it
makes
a bit more sense now. I need to start an Activit for now and not a
service
and I think I intermixed the two. I do get the Activity to start with
the
context.startActivity and it does what I want it to do - but I do see
now
what you are saying.

Thanks Kostya

On May 19, 5:51 pm, Kostya Vasilyev <[email protected]> wrote:
> StartActivityForResult is a method of Activity, not Context. You can
> typecast if appropriate.
>
> If not (i.e. your Context is a service or a receiver), then it doesn't make
> sense - because the result callback used by startActivityForResult is also a
> method of Activity.
>
> If this case, use a broadcast, a pending intent, or a handler message (just
> some of the options) to send/receive the result.
>
> Oh, and I see that the intent you're trying to start is for a service. Using
> startActivity (for result or not) with a service intent just doesn't make
> sense.
> 20.05.2011 1:41 пользователь "kypriakos" <[email protected]> написал:
>
> > That's what I said too - huh? ;)
>
> > Intent intent = new Intent();
> > intent.setClass(androidContext,
> > mysnapPic2ServiceImpl.class);
> > intent.setFlags(intent.FLAG_ACTIVITY_NEW_TASK);
> > intent.putExtra("from", "1");
> > final int result=1;
> > // androidContext.startActivity(intent);
> > androidContext.startActivityForResult(intent, result);
>
> > The startActivity method (commented out) is found fine when used - the
> > one below it gives:
>
> > [ERROR] snapPic2Servlet.java:[89,22] cannot find symbol
> > symbol : method startActivityForResult(android.content.Intent,int)
> > location: class android.content.Context
>
> > It has to be something stupid I can't see right now ...
>
> > On May 19, 2:12 pm, Kostya Vasilyev <[email protected]> wrote:
> >> Huh?
>
> >>http://developer.android.com/reference/android/app/Activity.html#star...,
> >> int)
>
> >> Since API level 1 - i.e. Android 1.0.
>
> >> Perhaps you could post a code snippet showing the compile error.
>
> >> -- Kostya
>
> >> 19.05.2011 22:04, kypriakos пишет:
>
> >> > So the API level 4 (to which cupcake/1.6 is based on) does not have
> >> > the startActivityForResult -
> >> > which is in line with the fact that the compilation fails.
>
> >> --
> >> Kostya Vasilyev --http://kmansoft.wordpress.com
>
> > --
> > 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