'Android reduce space between back icon and header text

i am new to android and facing with issue, any help will be grateful, thanks in advance.

I have added following code to create a back arrow on every page.

<activity
            android:name=".Leaves"
            android:parentActivityName=".Dashboard" />

Above code successfully created the back arrow on left top corner of screen.

Also i have added following class in my Java Class file to set header text

setTitle("Leave History");

Now the actual screen look like this

enter image description here

Actualy i want to reduce the space between back arrow and Title. I have googled for long time but all the solution are related to toolbar, i am not using toolbar. Will anyone put me on right track what mistake i doing. Thanks in advance.



Solution 1:[1]

You can configure the padding of the toolbar icon and title with these xml-attributes in your toolbar:

app:contentInsetStart
app:contentInsetEnd
app:contentInsetLeft
app:contentInsetRight
app:contentInsetStartWithNavigation

If you set app:contentInsetStart to 0dp, the space should dissappear.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1