Reputation: 12896
My application shall work the following way:
EditText
) and a button.onSearchRequested()
.ListActivity
. It provides a list of items via setListAdapter()
.Bullets #1-3 are clear and working. However I don't have any idea how to implement #4. I know about the possibility to use intents but it doesn't work if I use an intent after onSearchRequested()
.
Thanks,
Robert
Upvotes: 1
Views: 1731
Reputation: 12896
The following solution is working fine for me:
http://blog.dpdearing.com/2011/05/getting-android-to-call-onactivityresult-after-onsearchrequested/
Upvotes: 4
Reputation: 49410
I would simply send an intent with your selected item as extra (putExtra
) to your activity#1
(since the search dialog is between activity#1
and activity#2
, you can not use startActivityForResult
to post back the result to activity#1
)
If the search dialog is in activity#1
, then you can use startActivityOnResult
(thanks dmon)
Upvotes: 1
Reputation: 1577
Simple, quick fix: store the data statically and do a check to retrieve it in Activity #1's onResume().
Upvotes: 0