Jak wyrównać tytuł w centrum ActionBar w domyślnym motywie (Theme.Holo.Light)

Szukałem dużo, ale nie mogę znaleźć sposobu, w jaki sposób ustawić następnie tytuł na środku ActionBar zamiast wyrównany do lewej. Użyłem poniższego kodu, aby ustawić tytuł w centrum:

ViewGroup decorView= (ViewGroup) this.getWindow().getDecorView();
LinearLayout root= (LinearLayout) decorView.getChildAt(0);
FrameLayout titleContainer= (FrameLayout) root.getChildAt(0);
TextView title= (TextView) titleContainer.getChildAt(0);
title.setGravity(Gravity.CENTER);

Ale daje błąd jak poniżej:

ClassCastException : com.android.internal.widget.ActionBarView can not 
be cast to android.widget.TextView.

Każde inne rozwiązanie .. Każda pomoc zostanie doceniona.

questionAnswers(11)

yourAnswerToTheQuestion