Open rpattabi opened 7 years ago
From the code, I see that the listener is weak referenced. Since we set the listener at onCreate() and the dialog only pops up when we close the app, it is likely that OnClickButtonListener
object is garbage collected since there is no strong reference to this object. If the object is gone, the callback won't happen.
I think the weak reference is used mainly with the assumption that the activity itself is the listener. So the work around is to make activity implement OnClickButtonListener
interface and set listener like this: .setOnClickButtonListener(this)
I confirm if Activity itself implements OnClickButton
interface, the callback works correctly. But this shall be fixed if my above understanding is correct. It is very common to create listeners inline in java.
Hi @rpattabi ,
Fixed in https://github.com/Vorlonsoft/AndroidRate since Release 1.2.1
I found that my callback for onClickButton() did not happen. I just followed what is recommended in README.