        binding.tvSearch.doAfterTextChanged {
            if (it.toString().isNotEmpty()) {
                val text = it.toString()
                timer.cancel()
                timer = Timer()
                timer.schedule(
                        object : TimerTask() {
                            override fun run() {
                                runOnUiThread {
                                    fetchData(text)
                                }
                            }
                        },
                        DELAY
                )
            }
        }


this   fetchData(text) called everytime user finish typing, example user want to search BUDI, but after type B the fetch data called.

i want that code executed only after user finish typing