I have used setDisplayHomeAsUpEnabled(true) to display the home up icon. That works fine, but it takes a lot of margin which I am trying to reset by using the below code -
ImageView view = findViewById(android.R.id.home);
view.setPadding(7,0,0,0);
But it returns null pointer exception.
Code to enable the home up icon -
final LayoutInflater actionBarInflater = (LayoutInflater)
this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View viewActionBar = actionBarInflater.inflate(R.layout.action_bar, null);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
Image shows the home up icon and my app icon, i want to reduce the space between theme
Any help is appreciated. Thank you!