How do I invoke the search dialog using onSearchRequested()

前端 未结 4 1375
执笔经年
执笔经年 2021-02-15 17:51

I\'m trying to implement the search dialog and I am unable to display the search from an Activity.

I have my main activity defined in my manifest file, this activity sho

4条回答
  •  太阳男子
    2021-02-15 18:22

    did you check your res/xml/searchable.xml?

    
    
    
    

    Search dialog doesn't show up when you have hard coded strings for hint and label. They have to be @string resources.

    Also, there is no need to call or override the onSearchRequested() method in your calling activity unless you want to invoke search from one of your UI widgets like a Button or a ListItem.

提交回复
热议问题