Search in sources :

Example 1 with HasLifecycleMethods

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

the class OrmLiteHolder method injectReleaseInOnDestroy.

private void injectReleaseInOnDestroy(JFieldVar databaseHelperRef) {
    if (holder() instanceof HasLifecycleMethods) {
        JBlock destroyBody = ((HasLifecycleMethods) holder()).getOnDestroyBeforeSuperBlock();
        destroyBody.staticInvoke(getJClass(OrmLiteClasses.OPEN_HELPER_MANAGER), "releaseHelper");
        destroyBody.assign(databaseHelperRef, _null());
    }
}
Also used : HasLifecycleMethods(org.androidannotations.holder.HasLifecycleMethods) JBlock(com.helger.jcodemodel.JBlock)

Aggregations

JBlock (com.helger.jcodemodel.JBlock)1 HasLifecycleMethods (org.androidannotations.holder.HasLifecycleMethods)1