开发者

How do I implement onSearchRequested in activity started by startActivityForResult

开发者 https://www.devze.com 2023-03-02 19:07 出处:网络
I need to pick a contact number to populate a number field in my main activity. I start another activity displaying a list of contact numbers using,

I need to pick a contact number to populate a number field in my main activity. I start another activity displaying a list of contact numbers using,

Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI); startActivityForResult(contactPickerIntent, PICK_CONTACT_REQUEST);

I have the onActivityResult() method to parse the results. The problem is impleme开发者_如何学JAVAnting a search method to search the list of contact numbers. I tried to use onSearchRequested() but this works for the Main activity.

Any idea on how do I implement onSearchRequested() for the activity spawned by thecontactPickerIntent Intent.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号