pastebin search -- Adapter fun filterList(filterList: MutableList) { // below line is to add our filtered // list in our course array list. listData = filterList // below line is to notify our adapter // as change in recycler view data. notifyDataSetChanged() } -- Activity pastebin search PasteShr pastebin search private fun initView(){ with(binding){ adapter = AdapterPiutang() lvData.layoutManager = LinearLayoutManager(baseContext) lvData.adapter = adapter txtSearch.addTextChangedListener(object : TextWatcher { override fun beforeTextChanged( charSequence: CharSequence, i: Int, pastebin search How to dowload it? pastebin search i1: Int, i2: Int ) { } override fun onTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {} override fun afterTextChanged(editable: Editable) { //after the change calling the method and passing the search input filter(editable.toString()) } pastebin search How to use it? pastebin search }) btnAdd.setOnClickListener{ val intent = Intent(baseContext, PiutangInputActivity::class.java) startActivity(intent) } } } private fun filter(text: String) { pastebin search How to dowload it? pastebin search //new array list that will hold the filtered data val filterdNames = mutableListOf() //looping through existing elements for (s in listData) { //if the existing elements contains the search input if (s.nama?.lowercase()!!.contains(text.lowercase())) { //adding the element to filtered list filterdNames.add(s) } pastebin search How to get it? pastebin search } //calling a method of the adapter class and passing the filtered list adapter.filterList(filterdNames) } pastebin search