I have a problem when changing the icon of the toolbar, the return one for an x, I tried if it changes it, but the size is not what I expected.
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_clear_black_24dp);
It goes like this:
I would like it to be normal size, I put it a little smaller but it all comes out pixelated, there is a way to put it normal or by default but make it a clear or cancel button like an x.
The size should be per guideline 24dp makes sure to have that size and you can use the android:minHeight="?attr/actionBarSize" property in your toolbar to size the icon properly.
I was asking if you used a FrameLayout to contain the button, if so you can use the property: