https://kotlinlang.org logo
#android
Title
# android
o

Owen Carpenter

02/01/2019, 2:29 AM
Copy code
private fun postData(resource: String, request: Model.Request, view: ImageButton){
        view.setPressed(true)
        disposable = apiService.postData(resource, request)
                .subscribeOn(<http://Schedulers.io|Schedulers.io>())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(
                        { r -> view.setPressed(false)
                            toast("Success")},
                        { e -> toast("Error")}
                )

    }
m

Murtaza Hussain

02/03/2019, 6:22 AM
Being
pressed
and touched is are two different things, if you want to programmatically call press the button call
view.performClick
2 Views