Can You Have Two Activities Running At The Same Time?
Solution 1:
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.html
You should program your server as a Service
and then write an Activity
that communicates with the server and displays relevant information. This way when you navigate to a new Activity
the server continues to run.
Solution 2:
Can you have two activity's running at the same time
Not in the sense that you are expecting. In Android Activities are stored on a stack, only the top one on the stack is shown on the screen. While the other activities that aren't at the top are not necessarily all the way "dead" they are not alive enough to do that work for you.
You should instead make your server into a Service.
Solution 3:
you can try multi-window, perhaps not your expected: https://developer.android.com/guide/topics/ui/multi-window
Post a Comment for "Can You Have Two Activities Running At The Same Time?"