I have the next UI hierarhy:
FragmentActivity
-> Fragment
with TabHost
and LocalActivityManager -> MyNestedActivity
MyNestedActivity places in single tab in Fragment
. When I call startActivityForResult()
in MyNestedActivity, Activity
starts normally, but onActivityResult()
in never called.
But if I open MyNestedActivity using startActivity()
, onActivityResult()
works fine.
When I must hook onActivityResult()
? In FragmentActivity
on in Fragment
? How I must dispatch result to my MyNestedActivity?
SOLVED:
In this UI hierarhy onActivityResult()
not called. I just change MyNestedActivity to Fragment
and my hierarchy become FragmentActivity
-> Fragment
. Now onActivityResult()
works fine.
onActivityResult()
in nested Activity
not call by Android.
The correct way to get activity result in nested activity is:
startActivityForResult()
from host Activity
(not from nested!),
receive Activity
result in host Activity
,
dispatch Activity
result to nested Activity
.