Question: I'm using a search view in my application. Now i just want to get the text typed in the SearchView text box and display it on another textview. If i typed the text and click a button i can do the same. But i don't want to use any extra buttons. I just want to display the result when i am pressing enter key.

Answer: 
It also can be done with RXAndroid and RxBinding by Jake Wharton like this:

```
RxSearchView.queryTextChanges(searchView)
            .debounce(500, TimeUnit.MILLISECONDS)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Action1<CharSequence>() {
                @Override
                public void call(CharSequence charSequence) {
                    if(charSequence!=null){
                        // Here you can get the text
                        System.out.println("SEARCH===" + charSequence.toString());
                    }
                }
            });

```

Code is subscribing to observe text change with some delay of 500 milliseconds. 

This is a link to git repo to get RXAndroid:
<https://github.com/JakeWharton/RxBinding>
with extension functions, create `SearchViewExtensions.kt`

```
import android.view.View
import androidx.appcompat.widget.SearchView

inline fun SearchView.onQueryTextChanged(crossinline listener: (String) -> Unit) {
    this.setOnQueryTextListener(object: SearchView.OnQueryTextListener {
        override fun onQueryTextSubmit(query: String?): Boolean {
            return true
        }

        override fun onQueryTextChange(newText: String?): Boolean {
            listener(newText.orEmpty())
            return true
        }
    })
}

```

and the ***magic*** in your fragment

```
mSearchView.onQueryTextChanged { query: String ->
     // do whatever
}

```