How to replace deprecated android.support.v4.app.ActionBarDrawerToggle

后端 未结 4 1963
难免孤独
难免孤独 2020-11-28 21:49

Yesterday (17-10-2014) I have update Android SDK and support-library-v4.jar of my App, now I get deprecation warning related to ActionBarDrawerToggle

4条回答
  •  星月不相逢
    2020-11-28 22:04

    you must use import android.support.v7.app.ActionBarDrawerToggle;

    and use the constructor

    public CustomActionBarDrawerToggle(Activity mActivity,DrawerLayout mDrawerLayout)
    {
        super(mActivity, mDrawerLayout, R.string.ns_menu_open, R.string.ns_menu_close);
    }
    

    and if the drawer toggle button becomes dark then you must use the supportActionBar provided in the support library.

    You can implement supportActionbar from this link: http://developer.android.com/training/basics/actionbar/setting-up.html

提交回复
热议问题