0

I'm developing an app which like a city guide. I'm using a navigation drawer in order to show all categories in sliding menu.

However,I have some concern about its usage.My sliding menu only accept Fragment so I can only add Fragment to sliding menu and calling them from MainActivity by using FragmentManager/FragmentTransaction

How can I overcome this issue?

How can I use different type of compenents(Activity,FragmentActivity,ListActivity,ListFragment) on Sliding Menu(Navigation Drawer)?

Zafer Celaloglu
  • 1,438
  • 1
  • 17
  • 28

1 Answers1

1

If you want a navigation drawer, you should use fragments. It is very simple and very well explained here.

http://developer.android.com/training/implementing-navigation/nav-drawer.html

But if you still want to switch between Activities, so yes it is possible but Unfortunately, it's not a quick workaround, so if you have the option of using fragments, I would go with that.

For using navigation drawer with switching Activities, you can refer this accepted answer.

Community
  • 1
  • 1
Mukesh Rana
  • 4,051
  • 3
  • 27
  • 39
  • actually my question is not only using with activities How can I use mixed components such as FragmentActivity,ListFragment etc.? – Zafer Celaloglu Nov 05 '14 at 13:57
  • you are just trying to make things difficult for you.. use fragments, they are preffered/recommended for use with navigation drawer – Mukesh Rana Nov 06 '14 at 04:48
  • sometimes it's difficult to convert Activity,ListActivity etc. to Fragment for me :) – Zafer Celaloglu Nov 06 '14 at 07:27
  • hehe.. it will be even more difficult for you to switch between Activities lol. Moreover, you have to just copy paste your activities code in fragments, so what so difficult in that. If still, you find everything difficult, you can create multiple activities with each activity containing a navigation drawer. On click of every item in your navigation drawer,you will open an Activity that will contain same navigation drawer too. But this is not at all recommended and preffered way. – Mukesh Rana Nov 06 '14 at 08:17
  • Yeah,you are right recommended is Fragment because it has support different screen resolutions(Flexible design for developer).I'm learning life cycle of Fragment at the begining :) – Zafer Celaloglu Nov 06 '14 at 09:30
  • Gud... Go ahead. all the best..:) – Mukesh Rana Nov 06 '14 at 09:31
  • hehe.. you have to decide that, whether it helped you or not. – Mukesh Rana Nov 06 '14 at 09:36