Invoking android apk from another apk
I tried invoking an android apk (AA1) from another apk (BB1) by raising intent. But BB1 s开发者_如何转开发tarts starts AA1 in its own process space and it does not use the existing running process of AA1. How can I achieve a. I want BB1 to use existing AA1 if it is already running. b. If it is not already there, it should invoke AA1 as an independent application.
a. I want BB1 to use existing AA1 if it is already running
You can try having BB1 use Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP
as flags on the Intent
used to start the activity from AA1, though I have only tried this for a single app, not between two apps.
b. If it is not already there, it should invoke AA1 as an independent application.
This will happen by default.
I think by setting same process ID in Manifest.xml will work.
精彩评论