How to change the standard icon depicting three strips to another, for example a bucket or an arrow pointing to the right?

1 answer 1

According to en-SO

//убираем иконку mDrawerToggle.setDrawerIndicatorEnabled(false); //устанавливаем свою в тулбар mToolbar.setNavigationIcon(R.drawable.menu_icon); //назначаем слушатель нажатий mToolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //для примера откроем дровер по нажатию mDrawerLayout.openDrawer(Gravity.LEFT); } }); 
  • I have already done this and it does not work with "syncState ()" ((and why I don’t know. Mtoggle.setDrawerIndicatorEnabled (false); mtoggle.setHomeAsUpIndicator (R.drawable.ic_format_list_bulleted); drawer.setDrawerListener (mtoggle); mtotelo ); // if this is removed then it works - user22940
  • one
    @semiromid, in this case, should not work - there is nothing to be synced - the indicator (icon) is mute, because it is disabled. - YurySPb
  • So what does this indicator do? Or what does syncState () do for the indicator? - user22940
  • one
    @semiromid, as far as I understand / know, the indicator makes a clear animation when opening / closing a drover. A syncState should update the picture of it (sticks / arrow) in some special cases. In any case, the call to this method is best left as in the examples / docks if you use the standard icon. If its - that, I think, it will not be needed. - YurySPb