Incrementing launchTimes when Orientation Change
inidamleader opened this issue · comments
I think there is a solution for this:
Use a static field (or companion object field in kotlin) "instanceNbr" in the class that invoke increaseLaunchTimes() function
This field must be incremented at each RateApp.builder instanciation, and then use it as a condition to call increaseLaunchTimes() function:
data class Builder(var activity: AppCompatActivity) {
...
init {
// By using instanceNbr the launchTimes will be incremented just at start of the application
// Recreate activity without killing the process will not call increment SharePref LaunchTimes
if (++instanceNbr == 1)
activity.increaseLaunchTimes()
}
...
companion object {
private var instanceNbr = 0
...
}
...
}
Hi @inidamleader, I'm not sure if I get your issue right. Did you read the following section of the readme? If that doesn't solve your issue please describe you problem a little bit more.