0
I have a class that extends FragmentActivity
to call the map, and other classes that are just Fragment
. How I do the method to call the screens by NavigationDrawerFragment
?
0
I have a class that extends FragmentActivity
to call the map, and other classes that are just Fragment
. How I do the method to call the screens by NavigationDrawerFragment
?
1
In your class where you have navigation Drawer create a method similar to this
public void selectItem(int position) {
int title = 0;
fragment = null;
boolean withTabs = false;
switch (position) {
case 1:
title = R.string.tipu_title;
fragment = new MainFragment();
withTabs = true;
break;
}
if (title != 0) {
setTitle(title);
}
mDrawerLayout.closeDrawer(menuList);
if (position != currentPosition) {
setCurrentPage(fragment, withTabs);
currentPosition = position;
}
}
Then in the classes where you want to go to another Ragment is just to call it that way
((ClasseNavigationDrawer)getActivity()).selectItem(position);
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.
Anderson, could you include the code of your
Activity
and ofNavigationDrawer
who made?– Wakim