public class

MessageFragment

extends Fragment
java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ com.urbanairship.messagecenter.MessageFragment

Class Overview

Fragment that displays a RichPushMessage.

Summary

Constants
int ERROR_DISPLAYING_MESSAGE Error displaying the message.
int ERROR_FETCHING_MESSAGES Unable to fetch messages.
int ERROR_MESSAGE_UNAVAILABLE Message has been deleted or expired.
Public Constructors
MessageFragment()
Public Methods
String getMessageId()
Returns the fragment's RichPushMessage ID.
static MessageFragment newInstance(String messageId)
Creates a new MessageFragment
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Subclasses can override to replace with their own layout.
void onDestroyView()
void onPause()
void onResume()
void onStart()
void onStop()
void onViewCreated(View view, Bundle savedInstanceState)
Protected Methods
void retry()
Retries loading the message.
void showErrorPage()
This method is deprecated. Use showErrorPage(int) instead.
void showErrorPage(int error)
Shows the error page.
void showMessage()
Shows the message.
void showProgress()
Shows the progress bar
[Expand]
Inherited Methods
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.arch.lifecycle.LifecycleOwner
From interface android.arch.lifecycle.ViewModelStoreOwner
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener

Constants

protected static final int ERROR_DISPLAYING_MESSAGE

Error displaying the message.

Constant Value: 2 (0x00000002)

protected static final int ERROR_FETCHING_MESSAGES

Unable to fetch messages.

Constant Value: 1 (0x00000001)

protected static final int ERROR_MESSAGE_UNAVAILABLE

Message has been deleted or expired.

Constant Value: 3 (0x00000003)

Public Constructors

public MessageFragment ()

Public Methods

public String getMessageId ()

Returns the fragment's RichPushMessage ID.

Returns

public static MessageFragment newInstance (String messageId)

Creates a new MessageFragment

Parameters
messageId The message's ID to display
Returns
  • messageFragment new MessageFragment

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Subclasses can override to replace with their own layout. If doing so, the returned view hierarchy must have a UAWebView whose id is android.R.id.message, a progress view whose id is android.R.id.progress, and can optionally error page with a view id R.id.error.

Parameters
inflater The LayoutInflater object that can be used to inflate any views in the fragment,
container If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.
savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
Returns
  • Return the View for the fragment's UI, or null.

public void onDestroyView ()

public void onPause ()

public void onResume ()

public void onStart ()

public void onStop ()

public void onViewCreated (View view, Bundle savedInstanceState)

Protected Methods

protected void retry ()

Retries loading the message.

protected void showErrorPage ()

This method is deprecated.
Use showErrorPage(int) instead.

Shows the error page.

protected void showErrorPage (int error)

Shows the error page.

Parameters
error The error.

protected void showMessage ()

Shows the message.

protected void showProgress ()

Shows the progress bar