1. Download our Official Android App: Forums for Android!

Support navigation drawer getting stuck during opening and closing drawer

Discussion in 'Android Help' started by Android Question, Apr 21, 2016.

  1. Android Question

    Thread Starter
    Rank:
    None
    Posts:
    0
    Joined:

    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");
    }
    }
     

    Advertisement

Share This Page

Loading...