I have been trying to embed the Jetty WebServer inside my android app so that the app can act as a WebServer.
I have been able to do so using AsyncTask so that it runs in background. Then, I also have been able to instantiate a few servlets which function as expected.
Now in one of the servlets, I want the servlet to call an Activity to allow users to log in and provide some data and return those data to the servlet so that they can be sent back to the user. Since the servlet is running in background, I am struggling to call the activity from the servlet.
Now,I would like to know if there is any way to do so.
Any help or suggestion would be highly appreciated.
Thanks.
In the constructor of your AsyncTask, take a Context object as a parameter and store it locally. Now when you need to start the next Activity, use:
The AsyncTask will be something like:
And to create it use: