I'm trying to migrate my medium sized app to the new Android navigation
component.
Currently, my app consists of the single activity
and I'm planning on keeping it the same (for that matter); So, I'm facing this issue in which I have a settings fragment (PreferenceFragment
) that can be navigated to, basically, from every other fragment.
This navigation is made through a menu in the app bar, therefore onOptionsItemSelected
(containing this navigation) is in the main activity.
I'm having trouble figuring what is the right way to connect the settingsFragment
to the other ones.
Connecting it to all others seems like spaghetti to me.
Should settingsFragment
be connected to all another fragment?
Should I abandon the single activity application architecture since Google isn't giving enough reasons (or any reasons) to support it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…