What I have is an activity with a severer, and another activity with different information on it. However when I open the non-sever activity the sever closes. Is there a way that I can get this to stop? If you need to see any code I would be happy to show it.
Share
You cannot have multiple activities running at the same time. If you want code to run in the background you need to use a
Service. For more information checkout the docs: http://developer.android.com/reference/android/app/Service.htmlYou should program your server as a
Serviceand then write anActivitythat communicates with the server and displays relevant information. This way when you navigate to a newActivitythe server continues to run.