--- title: "Callbacks on Android" slug: "oapps-iga-callbacks-on-android-9-2-0" updated: 2026-10-20T11:52:43Z published: 2026-10-20T11:52:43Z canonical: "docs.onespan.com/oapps-iga-callbacks-on-android-9-2-0" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # Callbacks on Android ## ExtendedObserver interface The ExtendedObserver interface contains only one method: handleCallback(CallbackData data). The CallbackData object contains all information supplied for a given callback. > Security and priority are equally important in App Shielding. The EXIT reaction is safer than a callback and has therefore precedence over a callback. To reach the place in the code with the callback, the EXIT reaction that corresponds to this detection should be turned off. ## CallbackData class The CallbackData class serves as a base class for other classes that contain data for specific callbacks. These inherited classes reside in the no.promon.shield.callbacks package and have a ...Data suffix, for example RootingData or RepackagingData. Each callback has a type, represented by enumCallbackType and is available via the CallbackData.getCallbackType() method call. Based on the return value of the CallbackData.getCallbackType() call, the callback handler can cast the CallbackData object to the correct descending type that contains the data for the callback. > If CallbackData.getCallbackType() returned CallbackType.ROOTING, the callback handler should cast the CallbackData object to the RootingData object and then, using methods of the RootingData class, retrieve information specific to the ROOTING callback. For more information about callback data classes and callback types, see [CallbackType enum](/oapps/docs/oapps-iga-callbacktype-enum-9-2-0). ## Example code ### Java > ```java > public class ExtendedObserverImplementation implements ExtendedObserver { >                    public void handleCallback(CallbackData data) { >                    switch (data.getCallbackType()) { >                    case ROOTING: { >                    RootingData callbackData = (RootingData) data; >                    handleRootingCallback( >                    callbackData.isDeviceCertainlyRooted(), >                    callbackData.getRootingProbability()); >                    break; >                    } >                    case HOOKING_FRAMEWORKS: { >                    HookingFrameworksData callbackData = (HookingFrameworksData) data; >                    handleHookingFrameworksCallback( >                    callbackData.areHookingFrameworksPresent(), >                    callbackData.getLastUsedDetectionMethodCode()); >                    break; >                    } >                    ... >                    } >                    } >                    ... >                    } >                    ... >                    ExtendedObserver observer = new ExtendedObserverImplementation(); >                    CallbackManager.addObserver(context, observer); > ``` ### Kotlin > ```kotlin > class ExtendedObserverImplementation : ExtendedObserver { >                    override fun handleCallback(data: CallbackData) { >                    when (data?.callbackType) { >                    CallbackType.ROOTING -> { >                    val callbackData = data as RootingData >                    handleRootingCallback( >                    callbackData.isDeviceCertainlyRooted, >                    callbackData.rootingProbability >                    ) >                    } >                    CallbackType.HOOKING_FRAMEWORKS -> { >                    val callbackData = data as HookingFrameworksData >                    handleHookingFrameworksCallback( >                    callbackData.areHookingFrameworksPresent() >                    callbackData.getLastUsedDetectionMethodCode() >                    ) >                    } >                    ... >                    else -> { >                    ... >                    } >                    } >                    } >                    ... >                    } >                    ... >                    val observer: ExtendedObserver = ExtendedObserverImplementation() >                    CallbackManager.addObserver (context, observer) > ```