``` private fun postData(resource: String, req...
# android
o
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
Being
pressed
and touched is are two different things, if you want to programmatically call press the button call
view.performClick