Search code examples
javaandroidandroid-annotationsandroid-titlebar

Custom title with Android Annotations


Is it possible to set a custom title with the Android Annotations api? Previously I would call

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_layout);

in the onCreate method, but this doesn't appear to be possible in the @AfterViews annotated method, since it has to be done before the contentView is set. Is there a way to achieve this?


Solution

  • I was using com.googlecode.androidannotations, androidannotations-api version 2.7.1. There is a newer release; org.androidannotations, androidannotations version 3.0.1 which contains a @CustomTitle annotation which works perfectly.