-2

There is a drawer menu in my app and have four click item in drawer,now,i want to know which way is better:

  1. There are four fragment in a activity,when a click item clicked,just need to change fragment.
  2. There are two fragment in a activity,and hava another two activity.

Could you please tell me which one is better and why?

kk.hello
  • 1
  • 3
  • The overall trend is to use Fragments whenever it's possible. But Activities aren't all of that evil, after all. The first 11 versions of the Android OS worked upon Activities only. – Phantômaxx Apr 23 '16 at 09:12

2 Answers2

1

My suggestion as per your requirement fragment is best.

Bhadresh
  • 291
  • 1
  • 9
1

Well fragments are better in the case of a navigationDrawer because they will help building a dynamic UI, but it doesn't mean you are restricted to fragments only. You can have an activity with a navigationDrawer and multiple fragments in it, and for example another activity for the login or for a chat. It really depends on what you want to do.

David Seroussi
  • 1,650
  • 2
  • 17
  • 34