• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help navigation drawer getting stuck during opening and closing drawer

A

Android Question

Guest
in my application i have navigation drawer during navigation it get stuck in some fragment transition
i want smooth transition.. i am using following code for that

public void displayView(int position) {
// update the main content by replacing fragments
Fragment fragment = null;
switch (position) {
case 0:
fragment = new Profile_Fragment();
break;
case 1:
fragment = new Home_Fragment();
break;
case 3:
fragment = new Promos_Fragment();
break;
case 4:
fragment = new Vouchers_Fragment();
break;
default:
break;
}
if (fragment != null) {
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
// update selected item and title, then close the drawer
mDrawerList.setItemChecked(position, true);
mDrawerList.setSelection(position);
mDrawerLayout.closeDrawer(navDrawerView);
} else {
PrintLog.Log(TAG, "Error in creating fragment");
}
}
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones