I am trying to set Toolbar title where my code line is
View customView = getSupportActionBar().getCustomView();
TextView textViewToolbarTitle = (TextView) customView.findViewById(R.id.my_toolbar_title);
I am getting error as java.lang.NullPointerException
at
View customView = getSupportActionBar().getCustomView();
Please help.