Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Fail to propagate result for certain case #52

Open
dlackty opened this issue Feb 24, 2018 · 2 comments
Open

Fail to propagate result for certain case #52

dlackty opened this issue Feb 24, 2018 · 2 comments

Comments

@dlackty
Copy link

dlackty commented Feb 24, 2018

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.

@Override public void onActivityPaused(Activity activity) {
liveActivityOrNull = null;
}

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

Possibly related: #36
Possible fix: use getOLiveActivity instead

@dezarion
Copy link

Same problem

@stari4ek
Copy link

stari4ek commented Sep 3, 2018

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

if (activitiesLifecycle.getLiveActivity() == null) return;

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

stari4ek added a commit to stari4ek/RxActivityResult that referenced this issue Sep 10, 2018
Wait for activity to guarantee that no response will be lost
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants