public class

LandingPageActivity

extends Activity
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ com.urbanairship.actions.LandingPageActivity

Class Overview

An activity that displays a landing page.

The easiest way to customize the landing page view is to specify a theme for the activity in the AndroidManifest.xml. A custom layout can be specified by providing a metadata element com.urbanairship.action.LANDING_PAGE_VIEW with the specified view resource. When supplying a custom view, a UAWebView must be defined with id android.R.id.primary with an optional progress view with id android.R.id.progress. An optional close button can be added by defining it in the layout and setting the android:onClick="onCloseButtonClick". The onCloseButtonClick method will close the landing page by finishing the activity.

More extensive landing page customization can be defined by creating custom Activity. In the AndroidManifest.xml, define the landing page activity with an intent filter with action com.urbanairship.actions.SHOW_LANDING_PAGE_INTENT_ACTION, with category android:name="android.intent.category.DEFAULT", and data scheme "http", "https" and "message". The "message" scheme is used to display a RichPushMessage in the landing page. The message's ID is available as the getSchemeSpecificPart().

Summary

Constants
String LANDING_PAGE_BACKGROUND_COLOR Metadata extra to specify the web view's background color when displaying landing pages.
String LANDING_PAGE_VIEW_KEY Metadata extra to specify a custom landing page view.
[Expand]
Inherited Constants
From class android.app.Activity
From class android.content.Context
From interface android.content.ComponentCallbacks2
[Expand]
Inherited Fields
From class android.app.Activity
Public Constructors
LandingPageActivity()
Public Methods
void onCloseButtonClick(View view)
Finishes the activity.
final void onCreate(Bundle savedInstanceState)
void onNewIntent(Intent intent)
boolean onOptionsItemSelected(MenuItem item)
Determines if android.R.id.home was selected.
void onPause()
void onResume()
Protected Methods
void loadLandingPage(long delay)
Load the landing page uri with a delay
void loadLandingPage()
Loads the landing page uri
void onStart()
void onStop()
[Expand]
Inherited Methods
From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface android.view.KeyEvent.Callback
From interface android.view.LayoutInflater.Factory
From interface android.view.LayoutInflater.Factory2
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback

Constants

public static final String LANDING_PAGE_BACKGROUND_COLOR

Metadata extra to specify the web view's background color when displaying landing pages.

Constant Value: "com.urbanairship.LANDING_PAGE_BACKGROUND_COLOR"

public static final String LANDING_PAGE_VIEW_KEY

Metadata extra to specify a custom landing page view.

Constant Value: "com.urbanairship.action.LANDING_PAGE_VIEW"

Public Constructors

public LandingPageActivity ()

Public Methods

public void onCloseButtonClick (View view)

Finishes the activity.

Parameters
view The view that was clicked.

public final void onCreate (Bundle savedInstanceState)

public void onNewIntent (Intent intent)

public boolean onOptionsItemSelected (MenuItem item)

Determines if android.R.id.home was selected.

Parameters
item The menu item that was selected.
Returns
  • Return true if android.R.id.home was selected, otherwise false.

public void onPause ()

public void onResume ()

Protected Methods

protected void loadLandingPage (long delay)

Load the landing page uri with a delay

Parameters
delay Delay before loading the landing page. Delay of 0 or less will start loading the landing page immediately.

protected void loadLandingPage ()

Loads the landing page uri

protected void onStart ()

protected void onStop ()