Search in sources :

Example 1 with NonConfigurationHolder

use of org.androidannotations.holder.NonConfigurationHolder in project androidannotations by androidannotations.

the class NonConfigurationInstanceHandler method process.

@Override
public void process(Element element, EActivityHolder holder) throws JClassAlreadyExistsException {
    String fieldName = element.getSimpleName().toString();
    AbstractJClass fieldType = codeModelHelper.typeMirrorToJClass(element.asType());
    NonConfigurationHolder ncHolder = holder.getNonConfigurationHolder();
    JFieldVar ncHolderField = ncHolder.createField(fieldName, fieldType);
    injectInInit(element, holder, fieldName, ncHolderField);
    retainInOnRetain(holder, fieldName, ncHolderField);
}
Also used : NonConfigurationHolder(org.androidannotations.holder.NonConfigurationHolder) JFieldVar(com.helger.jcodemodel.JFieldVar) AbstractJClass(com.helger.jcodemodel.AbstractJClass)

Aggregations

AbstractJClass (com.helger.jcodemodel.AbstractJClass)1 JFieldVar (com.helger.jcodemodel.JFieldVar)1 NonConfigurationHolder (org.androidannotations.holder.NonConfigurationHolder)1