Cannot catch toolbar home button click event

前端 未结 11 2011
悲&欢浪女
悲&欢浪女 2020-11-27 02:56

I\'ve implemented the newest appcompat library and using the Toolbar as action bar. But the problem is I cannot catch the home button / hamburger icon click eve

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 03:11

        mActionBarDrawerToggle = mNavigationDrawerFragment.getActionBarDrawerToggle();
        mActionBarDrawerToggle.setToolbarNavigationClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // event when click home button
            }
        });
    

    in mycase this code work perfect

提交回复
热议问题