crash nullable getValue fix
This commit is contained in:
parent
0e06e1a9ac
commit
d20dd6daa4
|
|
@ -60,7 +60,7 @@ public class BaseLifecycleBindable implements LifecycleBindable {
|
|||
* Call it on parent's onStart method.
|
||||
*/
|
||||
public void onStart() {
|
||||
if (!isStartedSubject.getValue()) {
|
||||
if (isStartedSubject.hasValue() && !isStartedSubject.getValue()) {
|
||||
isStartedSubject.onNext(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ public class BaseLifecycleBindable implements LifecycleBindable {
|
|||
* In that case onResume will be called after onSaveInstanceState so lifecycle object is becoming started.
|
||||
*/
|
||||
public void onResume() {
|
||||
if (!isStartedSubject.getValue()) {
|
||||
if (isStartedSubject.hasValue() && !isStartedSubject.getValue()) {
|
||||
isStartedSubject.onNext(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ public class BaseLifecycleBindable implements LifecycleBindable {
|
|||
* Call it on parent's onSaveInstanceState method.
|
||||
*/
|
||||
public void onSaveInstanceState() {
|
||||
if (isStartedSubject.getValue()) {
|
||||
if (isStartedSubject.hasValue() && isStartedSubject.getValue()) {
|
||||
isStartedSubject.onNext(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ public class BaseLifecycleBindable implements LifecycleBindable {
|
|||
* Call it on parent's onStop method.
|
||||
*/
|
||||
public void onStop() {
|
||||
if (isStartedSubject.getValue()) {
|
||||
if (isStartedSubject.hasValue() && isStartedSubject.getValue()) {
|
||||
isStartedSubject.onNext(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue