urbanairship-core/src/main/java/com/urbanairship/iam/DisplayHandler.java
public boolean requestDisplayLock(Activity activity) {
        Autopilot.automaticTakeOff(activity.getApplication());

        InAppMessageManager manager = getInAppMessagingManager();
        if (manager == null) {
            Logger.error("Takeoff not called. Unable to request display lock.");
            return false;
        }

        return manager.requestDisplayLock(activity, scheduleId);
    }
/**
     * Called to obtain the display lock. If the in-app message is being displayed in a fragment or
     * directly in an activity, it should be called in the onStart method. If the in-app message is
     * attached directly to a view it should be called in the view's onWindowVisibilityChanged when
     * the window becomes visible.
     *
     * @param activity The activity.
     * @return {@code true} if the display lock was granted or the in-app message already contained
     * the lock. Otherwise {@code false}.
     */
Called to obtain the display lock. If the in-app message is being displayed in a fragment or
directly in an activity, it should be called in the onStart method. If the in-app message is
attached directly to a view it should be called in the view's onWindowVisibilityChanged when
the window becomes visible.

@param activity The activity.
@return  true if the display lock was granted or the in-app message already contained
the lock. Otherwise  false.
Called to obtain the display lock . If the in - app message is being displayed in a fragment or directly in an activity it should be called in the onStart method . If the in - app message is attached directly to a view it should be called in the view ' s onWindowVisibilityChanged when the window becomes visible . @param activity The activity . @return true if the display lock was granted or the in - app message already contained the lock . Otherwise false .
public boolean requestDisplayLock(Activity activity) {
        Autopilot.automaticTakeOff(activity.getApplication());
        InAppMessageManager manager = getInAppMessagingManager();
        if (manager == null) {
            Logger.error("Takeoff not called. Unable to request display lock.");
            return false;
        }
        return manager.requestDisplayLock(activity, scheduleId);
    }
public boolean requestDisplayLock ( Activity activity ) { Autopilot . automaticTakeOff ( activity . getApplication ( ) ) ; InAppMessageManager manager = getInAppMessagingManager ( ) ; if ( manager == null ) { Logger . error ( "Takeoff not called. Unable to request display lock." ) ; return false ; } return manager . requestDisplayLock ( activity , scheduleId ) ; }
Called to obtain the display lock.
Called to obtain the display lock .