title: SearchView suggestions inside recyclerview (with API call onQueryTextChange)
body: <p>I would like to display suggestions in recyclerView instead of embedded UI of the searchView (like on picture below)</p>
  <p><a href="https://i.stack.imgur.com/8WfkZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8WfkZ.png" alt="enter image description here" /></a></p>
  <p>Suggestions are loaded from API call on each text query change of my searchView.
  Then, each time I receipt new suggestions, I'm executing an AsyncTask which populate the UI suggestions using Cursor</p>
  <pre><code>class FetchSearchUserTermSuggestionsTask(var searchview: SearchView) : AsyncTask&lt;String?, Void?, Cursor&gt;() {
  
      override fun doInBackground(vararg params: String?): Cursor {
          val cursor =
              MatrixCursor(columnNamesArray)
  
          var list : List&lt;UserSuggestionDto&gt;? = null
  
          var call = RetrofitClient.userService.suggestionForTextSearch(0, 50, params[0]!!)
  
          val response  = call.execute()
          if (response.isSuccessful) {
              list = response.body()!!
          } else {
              //todo : throw exception
              Log.e(EventAddFragment.TAG, response.message())
              Log.e(EventAddFragment.TAG, response.errorBody().toString())
          }
  
          // parse your search terms into the MatrixCursor
          if(list != null) {
              for (index in list.indices) {
                  val term = list[index].fullname
                  val image = list[index].profilePic
                  val id = list[index].id
                  val row = arrayOf(index, id, image, term)
                  cursor.addRow(row)
              }
          }
          return cursor
      }
  
      override fun onPostExecute(result: Cursor) {
         searchview.suggestionsAdapter.changeCursor(result)
      }
  
      companion object {
          private val columnNamesArray = arrayOf(BaseColumns._ID,
              UserSuggestionDto.SUGGEST_COLUMN_ID,
              UserSuggestionDto.SUGGEST_COLUMN_IMAGE,
              UserSuggestionDto.SUGGEST_COLUMN_FULLNAME)
      }
  }
  </code></pre>
  <p>Finally, I prefer to populate a recyclerView in a dedicated fragment for research of user.
  Is There a specific way to do it ?</p>
  <p>My fears are :</p>
  <ul>
  <li>RecyclerView is not designed to use Cursor and AsyncTask (Contrary to the searchView suggestions adapter)</li>
  </ul>
  <p>So how to populate a recycler view from searchView on each text query change (by calling api each time) properly ?</p>
  <p>Thanks in advance</p>