V
V
Vik Ewoods2014-07-10 14:52:57
Android
Vik Ewoods, 2014-07-10 14:52:57

How to properly navigate through the product catalog?

Here is a small diagram of how I imagine it and do it:
navigation_vip_catalog.png
https://gist.github.com/vikewoods/1489433c77ccaf125767
But then the question arises how to correctly transfer data between fragments...
From the manuals, I realized that this should be implemented through the activity, which Fragments cannot communicate with each other directly. In Google, I still didn’t find an example of how to implement navigation for a multi-level catalog ...
I tried through activation, but something didn’t work out because I don’t know how to deal with NavigationDrawer ...
Please explain how to implement it correctly
Forgot to add an application is done only for Android KitKat & Android L (ListView for example can be replaced with RecyclerView if this somehow simplifies the task...)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
anyd3v, 2014-07-10
@anyd3v

How do you use NavigationDrawer? In theory, it should have a ListView (without any fragments), an adapter is created in the activity, a listener is installed, and add / replace fragments are done through the FragmentManager. If the presence of a fragment in the NavigationDrawer is critical, then what prevents doing this.getActivity().getFragmentManager() in the fragment itself and doing the same replace / add as in the examples when this is done directly in the activity?

M
Marat S, 2014-07-10
@aratj

and than you do not like Master/Detail?
developer.android.com/training/implementing-naviga...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question