Would there be an advantage to moving the service setups from MainActivity and AppDelegate to the App class constructor? #223
Answered
by
brminnick
rs-mobitech
asked this question in
Q&A
-
I see in the Android MainActivity and the iOS AppDelegate you have the same code:
Would it better if this were moved to the constructor of the App class instead? Just wondering why you chose to do it this way and if there is any advantage to doing it the way that you did? |
Beta Was this translation helpful? Give feedback.
Answered by
brminnick
Feb 25, 2021
Replies: 1 comment 2 replies
-
Hey @rscholey! I don't really have a good reason for this. I guess I could add This would allow the code in both var app = ContainerService.Container.Resolve<App>();
LoadApplication(app); Is this the solution you had in mind? |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rs-mobitech
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @rscholey!
I don't really have a good reason for this. I guess I could add
App
to the Dependency Injection Container, here https://github.com/brminnick/GitTrends/blob/main/GitTrends/Services/ContainerService.csThis would allow the code in both
MainActivity
andAppDelegate
to be condensed to this:Is this the solution you had in mind?