android - Passing activity result back to grandparent activity (not parent) -
i have situation in have 3 activities.
- resultsactivity
- simplesearchactivity
- complexsearchactivity
the flow works follows: user can choose search resultsactivity launch simplesearchactivity. there user can perform simple search. result pass results activity.
however simplesearchactivity user can choose complex search finish simplesearchactivity , launch complexsearchactivity. there want pass result resultsactivity. not sure how since 3rd activity not launched first activity, second.
options have considered:
in complex search case go resultsactivity , launch complexsearchactivity there. not sure want don't want simplesearch close go results launch complex. worried 'flash' resultsactivity before launching complexsearchactivity.
in complex search case, simplesearch launch complexsearch startactivityforresult(...), on complex finish simple search can grab result, pass results activity. not sure chaining work. if worried on complex finish simplesearchactivity 'flash' pass results back.
store search results in static variable somewhere , on resultsactivity launch check static variable might have been set either search activity. yuck!
i have thought of having 1 search activity , doing show/hide on fields (simple vs complex). launch simple search dialog activity (in tablet case) , complex search full screen activity. cannot use same search activity.
ideas? has tried before?
there couple ways can achieve this:
option 1: can choose not close simplesearchactivity
when launch complexsearchactivity
. instead, have complexsearchactivity
send result simplesearchactivity
, , there have simplesearchactivity
pass result resultsactivity
.
update: will, @ least in experience, have no ui "flash"; should appear seamless.
option 2: use flag_activity_forward_result, exists purpose.
Comments
Post a Comment