I have a MapActivity that will display the Android Search box when a search button is pressed. The SearchManager manages the dialog, and passes the user's query to a searchable activity, which searches an SQLite DB and displays the results using a custom adapter.
This works fine - and I'm getting the correct results from the DB displayed.
However, what I want to do is display the result in the MapActivity on a map when the user clicks on a search result. Currently, this means starting a new MapActivity, passing the search result in using a Bundle.
I'd have thought the cleaner way was to pass the search result back to the original activity, rather than start a new one. At the moment, my activity stack goes MapAct -> SearchManager -> Search Result -> New MapAct. Which means pressing "back" from the new MapAct will go back to the query results, then to the original MapAct.
It seems that in the Search Result, calling finish() does not cause onActivityResult to be called in the calling MapActivity.
Any ideas how to get this callback and maintain a sensible activity stack?