title: Android studio searchview : not showing search results
body: <p>First of all, I apologize for my poor English skills.</p>
  <p>I'm a beginner in android studio. I'm implementing an app with search function added to <code>recyclerview</code> using <code>searchview</code>. However, despite using <code>getFilter()</code>, the search results are not displayed in the <code>recyclerview</code>. I don't know what my mistake is. It would be of great help if you could let me know what I'm missing.</p>
  <p>My <code>xml</code> code</p>
  <pre><code>&lt;com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:id=&quot;@+id/main_frame&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:gravity=&quot;bottom&quot;
      app:umanoDragView=&quot;@id/slide_layout&quot;
      app:umanoPanelHeight=&quot;16dp&quot;
      tools:context=&quot;.MainActivity&quot;&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id=&quot;@+id/first_layout&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;&gt;
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:id=&quot;@+id/inside_layout&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;260dp&quot;
              android:background=&quot;#8BC34A&quot;
              app:layout_constraintBottom_toTopOf=&quot;@id/search_view&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/app_name&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:text=&quot;co-investor&quot;
                  android:textSize=&quot;30dp&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/str_total&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:text=&quot;총 게시물 개수&quot;
                  android:textSize=&quot;40dp&quot;
                  app:layout_constraintBottom_toTopOf=&quot;@id/total&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@id/app_name&quot; /&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/total&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:text=&quot;300개&quot;
                  android:textSize=&quot;50dp&quot;
                  app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@id/str_total&quot;
  
                  /&gt;
  
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  
          &lt;androidx.appcompat.widget.SearchView
              android:id=&quot;@+id/search_view&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              app:layout_constraintBottom_toTopOf=&quot;@id/recyclerview&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toBottomOf=&quot;@id/inside_layout&quot; /&gt;
  
  
          &lt;androidx.recyclerview.widget.RecyclerView
              android:id=&quot;@+id/recyclerview&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;430dp&quot;
              android:paddingBottom=&quot;15dp&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toBottomOf=&quot;@id/search_view&quot; /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
      &lt;androidx.fragment.app.FragmentContainerView
          android:id=&quot;@+id/slide_layout&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;430dp&quot;
          android:background=&quot;#ffffff&quot;&gt;
      &lt;/androidx.fragment.app.FragmentContainerView&gt;
  
  
  &lt;/com.sothree.slidinguppanel.SlidingUpPanelLayout&gt;
  </code></pre>
  <p>My <code>MainActivity</code> code</p>
  <pre><code>class MainActivity : AppCompatActivity() {
      private lateinit var binding: ActivityMainBinding
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          binding = ActivityMainBinding.inflate(layoutInflater)
          setContentView(binding.root)
  
          val coinList = ArrayList&lt;CoinList&gt;()
  
          for (i in 0 until 50) {
              coinList.add(CoinList(&quot;a&quot; + i, &quot;count : &quot; + i))
          }
  
          
          val adapter = RecyclerViewAdapter(coinList, LayoutInflater.from(this@MainActivity))
          val recycler_view: RecyclerView = findViewById(R.id.recyclerview)
          recycler_view.adapter = adapter
          recycler_view.layoutManager = LinearLayoutManager(this)       
  
      }
  
      class CoinList(val name: String, val count: String) {
  
      }
  
  
      //RecyclerViewAdapter
      class RecyclerViewAdapter(
          val itemList: ArrayList&lt;CoinList&gt;,
          val inflater: LayoutInflater
      ) : RecyclerView.Adapter&lt;RecyclerViewAdapter.ViewHolder&gt;(), Filterable {
          private var searchList: ArrayList&lt;CoinList&gt;? = null
  
          inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
              val name: TextView
              val count: TextView
  
              init {
                  name = itemView.findViewById(R.id.coin_name)
                  count = itemView.findViewById(R.id.coin_count)
              }
          }
  
          init {
              this.searchList = itemList
          }
  
          override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
              val view = inflater.inflate(R.layout.item_view, parent, false)
              return ViewHolder(view)
          }
  
          override fun onBindViewHolder(holder: ViewHolder, position: Int) {
              holder.name.setText(itemList.get(position).name)
              holder.count.setText(itemList.get(position).count)
              holder.itemView.setOnClickListener {
              }
          }
          
          override fun getItemCount(): Int {
              return itemList.size
          }
  
          //Filter
          override fun getFilter(): Filter {
              return object : Filter() {
                  override fun performFiltering(charSequence: CharSequence): FilterResults {
                      val charString = charSequence.toString()
                      if (charString.isEmpty()) {
                          searchList = itemList
                      } else {
                          val filteredList = ArrayList&lt;CoinList&gt;()
                          for (coin in itemList) {
                              if (coin.name.contains(charString) || coin.count.contains(charString)) {
                                  filteredList.add(coin)
                              }
                          }
                          searchList = filteredList
                      }
                      val filterResults = FilterResults()
                      filterResults.values = searchList
                      return filterResults
                  }
  
                  override fun publishResults(
                      charSequence: CharSequence,
                      filterResults: FilterResults
                  ) {
                      searchList = filterResults.values as ArrayList&lt;CoinList&gt;
                      notifyDataSetChanged()
                  }
              }
          }
      }
  
  
  </code></pre>
  <p>If anyone knows what I'm doing wrong, please let me know.
  Thank you!! :)</p>