I Initialize Publish Subject Rx Java in my activity like this
private var publisher = PublishSubject.create<Int>()
And I try to create simple publish onNext like this in a button :
binding.btnFab.setOnClickListener {
publisher.onNext(99)
}
I try to listen the changes in function
CompositeDisposable().add(publisher.ofType(Int::class.java).subscribe(
{
"ON NEXT ${it}"
},
{
"ON ERROR"
},
{
"ON COMPLETE"
}
))
But there is no one data that come out from my subscribe? do i make a mistake