Background : My app (A) is used by others app (B) to make an action on the behalf.
Expected result :
- Crashing app B => Crash app A and all launched threads.
- OR launhing app A activity on it's own app window.
Current behavior : startActivityForResult
open the called activity of app A within app B (window), so when I crash app B the app A onDestroy
baseActivity is called but not the threads launched by app A. Which not the case If I startActivity
is used with singleTask
as launchMode
, hence with the later method I have the app A activity launched in app A window and not within app B window , so I could simulate the crash of app A and I have the expected result.
Based on this comment by Ian Lake it seems there is no way to launch the activity of app A in it's own app back stack.
[EDIT 1]
Wanna to share this information :
When I launch my app directly through launcher icon and kill it => the process is killed instantly.
When I launch my app through startActivityForResult => the process is killed after about 2/3 seconds.
Checked using :
adb shell
top -m 5
Service
not anActivity
. Also, activities from different apps do not run in the same OS process and are very loosely coupled. Maybe you can explain more why you have this set up like you do? – Fant