I’m currently using a SearchView object in order to give my application functionality for suggested input.
This widget however, when submitted, uses an intent-filter to to initiate your searching. This is great when my application is run on a phone because what I want to do is launch a Search Results Activity to display the response. However on a tablet I want it to load my search results in a Fragment located in the current Activity!
I want my app to be as unified as possible (In terms of crossover between phone/tab) so instead of overwriting the submit behaviour as suggested in this answer I would like a new activity to be started which routes the search term where it needs to go. On a phone to the results Activity, on a tab I would like to pass the searchTerm to the previous Activity.
So I would like to ask – Can you pass information to a previous Activity in the backstack?
I would suggest you having your SearchCatchingActivity acting as a routing Activity. It can catch query and pass it to the required Activity (be it dual pane with result fragment or a single pane with single result fragment). Use
FLAG_ACTIVITY_CLEAR_TOPintent flag when routing to the next Activity so that it becomes the default Activity of that instance. Remember to callfinish()on your routing activity to remove it from the backstack as well.