public class

DisplayHandler

extends Object
implements Parcelable
java.lang.Object
   ↳ com.urbanairship.iam.DisplayHandler

Class Overview

Display handler for in-app message displays.

In-app message should call requestDisplayLock(Activity) before displaying the in-app message. Typically, this should be done in an Activity's or Fragment's onStart method, or if using a view, request the display lock when the attached activity visibility changes to VISIBLE in onWindowVisibilityChanged.

When the in-app message is finished, call finished(ResolutionInfo). This will finish the display of an in-app message and allow it to be triggered again by one of the in-app message triggers. If the hosting Activity finishes before the in-app message is able to be displayed, call continueOnNextActivity() to have the in-app message redisplay on the next activity.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Methods
void cancelFutureDisplays()
Prevents the message from displaying again.
void continueOnNextActivity()
Called when the in-app message needs to be displayed on the next activity.
int describeContents()
void finished(ResolutionInfo resolutionInfo)
Called when the in-app message is finished displaying.
boolean requestDisplayLock(Activity activity)
Called to obtain the display lock.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Methods

public void cancelFutureDisplays ()

Prevents the message from displaying again.

public void continueOnNextActivity ()

Called when the in-app message needs to be displayed on the next activity. After calling this method, the in-app message should immediately dismiss its view.

public int describeContents ()

public void finished (ResolutionInfo resolutionInfo)

Called when the in-app message is finished displaying. After calling this method, the in-app message should immediately dismiss its view to prevent the current activity from redisplaying the in-app message if still on the back stack.

Parameters
resolutionInfo Info on why the message has finished.

public boolean requestDisplayLock (Activity activity)

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.

Parameters
activity The activity.
Returns
  • true if the display lock was granted or the in-app message already contained the lock. Otherwise false.

public void writeToParcel (Parcel dest, int flags)