search pastebun -- 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 search pastebun How to use it? search pastebun 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, search pastebun How to get it for free? search pastebun 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()) } search pastebun How to dowload it? search pastebun }) btnAdd.setOnClickListener{ val intent = Intent(baseContext, PiutangInputActivity::class.java) startActivity(intent) } } } private fun filter(text: String) { search pastebun PasteShr search pastebun //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) } search pastebun How to get it for free? search pastebun } //calling a method of the adapter class and passing the filtered list adapter.filterList(filterdNames) } search pastebun