RxActivityResult icon indicating copy to clipboard operation
RxActivityResult copied to clipboard

Fail to propagate result for certain case

Open dlackty opened this issue 6 years ago • 2 comments

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

dlackty avatar Feb 24 '18 05:02 dlackty

Same problem

dezarion avatar Jun 27 '18 06:06 dezarion

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).

stari4ek avatar Sep 03 '18 22:09 stari4ek