android - Passing activity result back to grandparent activity (not parent) -


i have situation in have 3 activities.

  1. resultsactivity
  2. simplesearchactivity
  3. 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:

  1. 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.

  2. 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.

  3. store search results in static variable somewhere , on resultsactivity launch check static variable might have been set either search activity. yuck!

  4. 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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -