Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Why having multiple activities? #9

Closed
gderaco opened this issue May 29, 2018 · 4 comments
Closed

Why having multiple activities? #9

gderaco opened this issue May 29, 2018 · 4 comments
Assignees
Milestone

Comments

@gderaco
Copy link

gderaco commented May 29, 2018

According to this article, Google suggested using only one Activity:

Today we are introducing the Navigation component as a framework for structuring your in-app UI, with a focus on making a single-Activity app the preferred architecture. With out of the box support for Fragments, you get all of the Architecture Components benefits such as Lifecycle and ViewModel while allowing Navigation to handle the complexity of FragmentTransactions for you.

So my question is, why didn't you follow the advice yourself gave?

@ShiroYacha
Copy link

It does look a bit counter-intuitive that the "master-detail" view is split into 2 activities whereas the less related views are 2 fragments of the same view...

@XinyueZ
Copy link
Contributor

XinyueZ commented Jun 2, 2018

why not :)

@tiembo
Copy link
Contributor

tiembo commented Jun 4, 2018

That's correct - a single-Activity app is preferred. We'll be consolidating down to one activity.

@XinyueZ
Copy link
Contributor

XinyueZ commented Jun 5, 2018

@tiembo @gderaco Navigation within "single-activity" is really a good way to control application route and move direction, do it also, however, my point of view is that activity should capsulate "business" group. A typical example is that user-shop-buying.

I will user-profile with edit, list, view in one activity.
For shop, list, detail and gallery of item if needed in one activity.
Buying process in one activity.

Flexible with multi-single-activity is my variant of jetpack. This is my opinion

@tiembo tiembo closed this as completed in b736160 Jun 28, 2018
@tiembo tiembo added this to the 0.1.4 milestone Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants