android - ActionBarToggle burger to arrow not working -


i have implemented v7 version of , changed spin value true. still burger not converting stars. tried looking sample codes of had similar codes. tried toolbar extending main class activity class only. worked fine.

 bartoggle= new actionbardrawertoggle(this,mdrawerlayout,r.string.drawer_open,r.string.drawer_close){         @override         public void ondrawerclosed(view drawerview) {             super.ondrawerclosed(drawerview);          }          @override         public void ondraweropened(view drawerview) {             super.ondraweropened(drawerview);          }       };       mybar = getsupportactionbar();     mybar.setdisplayshowtitleenabled(false);     mybar.setdisplayhomeasupenabled(true);     mybar.sethomebuttonenabled(true); 

and stlye xml

<resources>  <!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light">     <!-- customize theme here. -->     <item name="colorprimary">@color/primarycolor</item>     <item name="colorprimarydark">@color/primarycolordark</item>       <item name="drawerarrowstyle">@style/drawerarrowstyle</item>  </style>  <style name="drawerarrowstyle" parent="widget.appcompat.drawerarrowtoggle">     <item name="spinbars">true</item>     <item name="color">@android:color/white</item> </style> 

try using

public class myactivity extends actionbaractivity {  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_my);      drawerlayout drawerlayout = (drawerlayout) findviewbyid(r.id.drawer);     android.support.v7.widget.toolbar toolbar = (android.support.v7.widget.toolbar) findviewbyid(r.id.toolbar);     actionbardrawertoggle actionbardrawertoggle = new actionbardrawertoggle(             this,             drawerlayout,             toolbar,             r.string.open,             r.string.close     )      {         public void ondrawerclosed(view view)         {             super.ondrawerclosed(view);             invalidateoptionsmenu();             syncstate();         }          public void ondraweropened(view drawerview)         {             super.ondraweropened(drawerview);             invalidateoptionsmenu();             syncstate();         }     };     drawerlayout.setdrawerlistener(actionbardrawertoggle);      //set custom toolbar     if (toolbar != null){         setsupportactionbar(toolbar);     }      getsupportactionbar().setdisplayhomeasupenabled(true);      actionbardrawertoggle.syncstate(); } 

}


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -