Ah sleep is good ...

Ok revisiting this I can see the wrong path I went down to ...

I built a servlet for the ijetty web server that launches an Activity
once
a particular remote request comes in. The ijetty code provides the
AndroidContext
in all servlets through:

        Object o =
config.getServletContext().getAttribute("org.mortbay.ijetty.contentResolver");
        android.content.ContentResolver resolver =
(android.content.ContentResolver)o;
        androidContext =
(android.content.Context)config.getServletContext().getAttribute("org.mortbay.ijetty.context");

So while implementing the methods for the servlet I got carried away
with the fact that I had
the appropriate context available and used the Context's startActivity
method and the Intent object to launch
the Activity (after I declared it in the ijetty's AndroidManifest). I
kept looking in there for the startActivityForResult
I needed a bit more reading on the difference between the two
startActivity methods across two different classes in the inheritance.
The code snippet I sent out does work but I cannot of course use the
startActivityForResult.
Up to this pt I was having the launched activity save the results in a
file and then had the servlet poll for
them but that's not an ideal solution. The servlet itself implements
HttpServlet so by not being an Activity
I could not see how any callback to it would be possible - what do you
think?

@Kostya
> If this case, use a broadcast, a pending intent, or a handler message (just
> some of the options) to send/receive the result.

I agree with that but I need to figure out how the servlet fits into
this. I could launch
the activity as a service.

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

Where do you see that? The intent I am starting is an Activity class.
Can you explain please?

Thanks again for the feedback to all fo you - it certainly helps

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