-
Notifications
You must be signed in to change notification settings - Fork 46
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
C: 2 - Refactor main activity start activities into Navigator #13
Comments
…ity-start-activities-into-navigator Moved all start activity code in main activity into the Navigator class. Closes #13
@vestrel00 I think for better understanding you could make an example with passing parameter to the navigator (for the starting activity). This is only a suggestion, and really not needed. |
What do you think about this: (It is a static method in the activity itself)
|
@Rainer-Lang you are correct. I did not include such an example because it was not needed. However, I should at least mention it in the blog in the refactor navigator section. Here is an example in the larger project: https://github.com/vestrel00/business-search-app-java/blob/develop/presentation-java-android-mvp/src/main/java/com/vestrel00/business/search/presentation/java/android/mvp/ui/business/details/BusinessDetailsActivity.java#L35 Thanks. |
@vestrel00 Why are you using an |
@Rainer-Lang good question. The reason is that sometimes there are certain flags that we want to add into the Intent. A good example are flags that modify the behavior of the tasks and back stack. An example for when this comes in handy is when we need to start an activity in We could add these flags as parameters to the static method, but that would involve adding more parameters or overloaded methods. We choose to limit the responsibility of the static method to adding extra parameters and other things (like intent flags / affinities) be handled in the With all that said, it still just comes down to preference. Either way is fine. |
@vestrel00 Thanks for clarifying. I'm also considering using the lib "Dart and Henson". |
Move all start activity code in main activity into the Navigator class.
The text was updated successfully, but these errors were encountered: