Best Practice: Navigation Box

In the Android development tutorial in the navigation box design pattern, the recommended way to manage different layouts is to use fragments. These fragments are replaced by a transaction FragmentTransaction().replace(). In my opinion, fragments of the navigation box are usually exchanged and recharged. So it makes no sense to use the challenges FragmentTransaction.show()and FragmentTransaction.hide(), in this context?

What is the best practice to use NavigationDrawerright now?

+4
source share
2 answers

Yes, they are reloaded, just like actions ...

, Google : FragmentTransaction.replace(), :

  • , ^^
  • ,
+2

, .

.

, .

, , actionBar , .

Now as per Android documentation as you are referring .. it is always good to have fragment as they a light weighted in context of to use new activity each time for your app.

, !

+1

Source: https://habr.com/ru/post/1538100/


All Articles