-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Audit code for consistency in our Intent back stack management #17073
Comments
The description of this issue is the problem statement One would be a "startIntent" utility where you pass the class you want to start and some extras, and it would do the CLEAR_TOP etc Another would be the case that appears to also pretty regular with the NEW_TASK and some other flag Then scour the code for Intent creation and funnel it all through the utility methods and we would know that they were all behaving the same (and hopefully correctly...) |
Thanks for self assigning @xenonnn4w. I thought you were too busy with back to school currently to contribute. |
I think it may be related to #17083, where the stack don't always work as I expect, and this is frustrating. |
Apologies, but I won't be able to work on this for at least the next two weeks as I'm busy with my electronics projects and subjects. |
Never a problem! This is a "coding standards" / "consistency" exercise. There are probably some minor issues lurking around with our current lack of doing it the same way everywhere, but users aren't screaming about it... Good luck on your projects |
@mikehardy so the 2nd utility function should have a flag argument that takes other flag as input from the caller? and what about the places where CLEAR_TASK is used , and where CLEAR_TOP is |
Whatever seems the cleanest, if I spend too much time thinking about it I should just code it 😆 If I recall correctly the second case had same flags each time, so no need to parameterize |
on it |
@david-allison here is how I will do this, I am just going to create "IntentUtility" class with static functions and then replace each intent creation with function call |
I don't have a good mental model of how that will look, but give it a go If it's quick, do it all If it's not, provide a small patch fixing a few calls so we can see if it looks like a good approach Whatever documentation/research you have done on the issue will definitely stand the test of time |
https://github.com/search?q=repo%3Aankidroid%2FAnki-Android+Intent.FLAG_ACTIVITY_CLEAR&type=code
...shows we use CLEAR_TASK sometimes, an
or
if flags other times, and CLEAR_TOP other timesAll intent creation https://github.com/search?q=repo%3Aankidroid%2FAnki-Android+Intent%28context%2C+&type=code
look at:
Originally posted by @mikehardy in #17036 (review)
The text was updated successfully, but these errors were encountered: