Pregunta

I am using feinstein's SlidingMenu library, I want to use the SlidingMenu in every activity i have. Should I have to write the SlidingMenu code in every activty?!, or can I write the slidingMenu in a class and start calling the class in every activity or is there any other way? Thanks in advance.

¿Fue útil?

Solución

Best way would be to work with fragments. Add the drawer to your MainActivity extends FragmentActivity. Then add and remove fragments instead of switching activities.

Also, there's no need to use SlidingMenu anymore, Google added their own implementation, called NavigationDrawer to the Support Library. See http://developer.android.com/training/implementing-navigation/nav-drawer.html

Otros consejos

Simply create an abstract Activity that does that feature. than, each Activity will extend that basic abstract activity and you'll have the same behavior for them all.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top