Search code examples
androidrx-java2searchviewandroidx

RxSearchView not supporting androidx SearchView?


I've migrated my project to androidx. When i use RxSearchView it results in an error

RxSearchView.queryTextChanges(searchView).

Type mismatch. Required: android.widget.SearchView

Found:

androidx.appcompat.widget.SearchView


Solution


  • I was facing this problem recently and was able to fix it by using this explicit dependency: implementation 'com.jakewharton.rxbinding3:rxbinding-appcompat:3.0.0-alpha2'.

    You can find this dependency and some other ones at Github RxBinding.

    I hope I was not too late and I hope this helps!

    Edit
    I know I responded this not long ago but something messed up the library. 3.0.0-alpha is no longer the latest release and has been replaced with version 3.0.0 of which I no longer find RxSearchView anywhere, not even on the alpha version.


    Edit 2
    Since I never found RxSearchView again, I had to implement an OnQueryTextListener myself, following a pretty cool tutorial I found here. It uses Kotlin's new coroutines and works as fine as RxSearchview.