Android: Return search query to current activity

前端 未结 9 1153
半阙折子戏
半阙折子戏 2020-12-07 16:34

I followed the steps described on http://developer.android.com/guide/topics/search/search-dialog.html to implement a search feature in my notepad application.

My pro

9条回答
  •  难免孤独
    2020-12-07 17:17

    in the manifest file, add:

    android:launchMode="singleTop"
    

    To your search activity. Then, let your search activity implement SearchView.OnSuggestionListener finally:

    mSearchView.setOnSuggestListener(this)
    

    this way you can handle the suggestion click event with out creating a new instance of your search activity.

提交回复
热议问题