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

[Android] Fix back button crash + Cleanup #14

Merged
merged 4 commits into from
Jul 13, 2022
Merged

Conversation

LuckyDucko
Copy link
Owner

Fix for #13

This was causing a loop to call itself, as through AppHostBuilderExtensions this seems to get called, atleast thats what i believe is going on.

Removing this line seems to fix all the issues.

@LuckyDucko LuckyDucko requested a review from maxkoshevoi July 4, 2022 05:04
@LuckyDucko LuckyDucko self-assigned this Jul 4, 2022
@maxkoshevoi maxkoshevoi changed the title Update AndroidMopups.cs [Android] Fix back button crash Jul 4, 2022
@@ -31,8 +31,6 @@ public static bool SendBackPressed(Action? backPressedHandler = null)
return true;
}

backPressedHandler?.Invoke();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't backPressedHandler parameter be removed then, if it's never used? Why did we need it in the first place?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is why i made a PR ahaha.

So as far as im aware, if i keep that invoke in it makes an endless loop which crashes the system.

I think the original intention is to provide extra functionality on top.

The apphostbuilder area seems to be the only place this is registered, so perhaps we instead need to move that custom functionality to there somehow?

I'm on mobile, but i'll give this another shakedown, i need to learn more about apphostbuilder instead of just throwing everything at it and seeing what sticks

Copy link
Collaborator

@maxkoshevoi maxkoshevoi Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If backPressedHandler is not passed, backPressedHandler?.Invoke(); won't do anything, right? So the problem might be in the value this is passed in backPressedHandler, and not in the parameter itself.

Added TestPage extra
Fixed BackHandler Bug.
@LuckyDucko LuckyDucko requested a review from maxkoshevoi July 8, 2022 12:15
@LuckyDucko LuckyDucko linked an issue Jul 8, 2022 that may be closed by this pull request
@LuckyDucko LuckyDucko changed the title [Android] Fix back button crash [Android] Fix back button crash + Cleanup Jul 8, 2022
@LuckyDucko LuckyDucko linked an issue Jul 8, 2022 that may be closed by this pull request
@LuckyDucko LuckyDucko merged commit c6bb277 into master Jul 13, 2022
@LuckyDucko LuckyDucko deleted the LuckyDucko-patch-1 branch July 21, 2022 23:09
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

Successfully merging this pull request may close these issues.

[HouseKeeping] Clean up solution Android back button crashes
2 participants