Is it possible for two instances of the same Android application to exist simultaneously?

In a general Android application, is it possible for two process instances of the same application to exist simultaneously?

In other words, if I override Application.onCreate() , is it possible to call onCreate() when the previous application instance is still running in the linux core?

+5
source share
3 answers

For any particular application at any given time there will be no more than one instance of Application .

When the application component launches and the application does not have other running components, the Android system launches a new Linux process for the application with a single thread of execution. a source


[ Application Class] was created for you when creating a process for your application / package. source

+1
source

No, It is Immpossible. But this is possible when renaming the application package name inside apk and recompiling it. For your question this is not possible.

0
source

Please check the life cycle of the activity. If you run the action, it will call the oncreate method, if it is still in the background, then it will call onResume because it is in a pause state. The Linux kernel provides a unique identity for each application.

Suppose you started an operation and you called onCreate to start it again, it will first call the onDestroy or onStop method, then it will call onCreate.

-1
source

All Articles