I tried invoking an android apk (AA1) from another apk (BB1) by raising intent. But BB1 starts 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:
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.
CommonsWare
2010-08-31 12:09:14