如何更改android工具栏主图标

如何更改android工具栏主图标,android,android-studio,icons,toolbar,titlebar,Android,Android Studio,Icons,Toolbar,Titlebar,我正在尝试更改工具栏图标,如 到 同样的,后面的图标 我可以使用更改默认图标的颜色 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/whit</item> <item name="colorPrim

我正在尝试更改工具栏图标,如 到 同样的,后面的图标

我可以使用更改默认图标的颜色

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/whit</item>
    <item name="colorPrimaryDark">@color/whit</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="drawerArrowStyle">@style/IconStyle</item>
</style>

<style name="IconStyle" parent="@style/Widget.AppCompat.DrawerArrowToggle">
    <item name="spinBars">true</item>
    <item name="color">@color/name_heading</item>
</style>
但现在工作。 有没有办法从根本上解决这个问题 styles.xml
文件?

使用工具栏API<代码>工具栏。设置导航图标(…)你说的“主页图标”是什么意思?你们是在活动或片段中实现它的吗?请浏览这个链接,你们会在这里得到预期的答案
toolbar=findViewById(R.id.toolBarId);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_right_select);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_arrow_right_select);