Trying to set the ActionBar
title in middle instead of the default left aligned position. To do so, based on other answers this is what I\'ve done:
You need to use Toolbar
in your xml
file and you can use TextView
inside Toolbar
. You can add custom view into Toolbar
. Once you done with xml file then you can define Toolbar
into Activity
class.
//Rest of your code
In Activity class you can define as
Toolbar toolbar;
toolbar = (Toolbar) findViewById(R.id.ar_toolbar);
toolbar.setTitle("");