VictorAlbertos / RxActivityResult

A reactive-tiny-badass-vindictive library to break with the OnActivityResult implementation as it breaks the observable chain.
Apache License 2.0
593 stars 72 forks source link

Fail to propagate result for certain case #52

Open dlackty opened 6 years ago

dlackty commented 6 years ago

We're trying to integrate this library with Google SignIn, and however subscriber gets no result.

After investigation, we found that there's potential issue for this library. For Google SignIn, they use a SignInHubActivity, which presents a dialog then puts itself into pause state. Then when user click on the dialog option, it will set result and finish activity.

https://github.com/VictorAlbertos/RxActivityResult/blob/721d059a80c1489672479500c10294d4021f33a2/rx_activity_result/src/main/java/rx_activity_result2/ActivitiesLifecycleCallbacks.java#L37-L39

At this moment, RxActivityResult.activitiesLifecycle.getLiveActivity() returns null and thus breaks the expected subscription behavior.

Possibly related: #36 Possible fix: use getOLiveActivity instead

dezarion commented 6 years ago

Same problem

stari4ek commented 6 years ago

I have another case but which is very similar. I get OnResult.response right in the middle of onActivityPaused for target activity and onActivityResumed of starter activity.

so, OnResult.response is ignored and never processed again https://github.com/VictorAlbertos/RxActivityResult/blob/721d059a80c1489672479500c10294d4021f33a2/rx_activity_result/src/main/java/rx_activity_result2/RxActivityResult.java#L122

I have it only for specific devices which are slower than others (Sony TV).