[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activityMatchesIntent prevent intent alteration #1939

Open
rlatapy-luna opened this issue Sep 27, 2023 · 0 comments
Open

activityMatchesIntent prevent intent alteration #1939

rlatapy-luna opened this issue Sep 27, 2023 · 0 comments

Comments

@rlatapy-luna
Copy link

To avoid handling intent twice, we nullify the data of the intent after having processed it during the activity onCreate phase. It works great but it makes our test fails because of activityMatchesIntent test during scenario launch. How should we deal with that?

/** Observes an Activity lifecycle change events and updates ActivityScenario's internal state. */
private final ActivityLifecycleCallback activityLifecycleObserver =
new ActivityLifecycleCallback() {
@Override
public void onActivityLifecycleChanged(Activity activity, Stage stage) {
if (!activityMatchesIntent(startActivityIntent, activity)) {
Log.v(
TAG,
String.format(
"Activity lifecycle changed event received but ignored because the intent does"
+ " not match. startActivityIntent=%s, activity.getIntent()=%s,"
+ " activity=%s",
startActivityIntent, activity.getIntent(), activity));
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant