I wanna change default ActionBar homeAsUp indicator (drawable) in my AppCompat Toolbar. How to achieve that? Only default arrow shows up.
styles (same for other API\
i just found out that it actually works toolbar.setNavigationIcon(R.drawable.ic_action_back) and here is the code to make it work.
@Override
protected void onCreate(Bundle savedInstanceState) {
.....
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_action_back);
Post the following code in onOptionsItemSelected(MenuItem item)
@Override
public boolean onOptionsItemSelected(MenuItem item) {
......
if (id == android.R.id.home) {
startActivity(new Intent(this, MainActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
Note Mainactivity in this code is the current activity i want my back or home button to go to. I hope this helps