added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

ErrorSupportFragment

public class ErrorSupportFragment
extends BrandedSupportFragment

java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ android.support.v17.leanback.app.BrandedSupportFragment
       ↳ android.support.v17.leanback.app.ErrorSupportFragment


A fragment for displaying an error indication.

Summary

Public constructors

ErrorSupportFragment()

Public methods

Drawable getBackgroundDrawable()

Returns the background drawable.

View.OnClickListener getButtonClickListener()

Returns the button click listener.

String getButtonText()

Returns the button text.

Drawable getImageDrawable()

Returns the drawable used for the error image.

CharSequence getMessage()

Returns the error message.

boolean isBackgroundTranslucent()

Returns true if the background is translucent.

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

Called to have the fragment instantiate its user interface view.

void onStart()

Called when the Fragment is visible to the user.

void setBackgroundDrawable(Drawable drawable)

Sets a drawable for the fragment background.

void setButtonClickListener(View.OnClickListener clickListener)

Set the button click listener.

void setButtonText(String text)

Sets the button text.

void setDefaultBackground(boolean translucent)

Sets the default background.

void setImageDrawable(Drawable drawable)

Sets the drawable to be used for the error image.

void setMessage(CharSequence message)

Sets the error message.

Inherited methods

From class android.support.v17.leanback.app.BrandedSupportFragment
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener
From interface android.arch.lifecycle.LifecycleOwner
From interface android.arch.lifecycle.ViewModelStoreOwner

Public constructors

ErrorSupportFragment

added in version 22.1.0
ErrorSupportFragment ()

Public methods

getBackgroundDrawable

added in version 22.1.0
Drawable getBackgroundDrawable ()

Returns the background drawable. May be null if a default is used.

Returns
Drawable

getButtonClickListener

added in version 22.1.0
View.OnClickListener getButtonClickListener ()

Returns the button click listener.

Returns
View.OnClickListener

getButtonText

added in version 22.1.0
String getButtonText ()

Returns the button text.

Returns
String

getImageDrawable

added in version 22.1.0
Drawable getImageDrawable ()

Returns the drawable used for the error image.

Returns
Drawable

getMessage

added in version 22.1.0
CharSequence getMessage ()

Returns the error message.

Returns
CharSequence

isBackgroundTranslucent

added in version 22.1.0
boolean isBackgroundTranslucent ()

Returns true if the background is translucent.

Returns
boolean

onCreateView

added in version 22.1.0
View onCreateView (LayoutInflater inflater, 
                ViewGroup container, 
                Bundle savedInstanceState)

Called to have the fragment instantiate its user interface view. This is optional, and non-graphical fragments can return null (which is the default implementation). This will be called between onCreate(Bundle) and onActivityCreated(Bundle).

If you return a View from here, you will later be called in onDestroyView() when the view is being released.

Parameters
inflater LayoutInflater: The LayoutInflater object that can be used to inflate any views in the fragment,

container ViewGroup: 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 Bundle: If non-null, this fragment is being re-constructed from a previous saved state as given here.

Returns
View Return the View for the fragment's UI, or null.

onStart

added in version 22.1.0
void onStart ()

Called when the Fragment is visible to the user. This is generally tied to Activity.onStart of the containing Activity's lifecycle.

setBackgroundDrawable

added in version 22.1.0
void setBackgroundDrawable (Drawable drawable)

Sets a drawable for the fragment background.

Parameters
drawable Drawable: The drawable used for the background.

setButtonClickListener

added in version 22.1.0
void setButtonClickListener (View.OnClickListener clickListener)

Set the button click listener.

Parameters
clickListener View.OnClickListener: The click listener for the button.

setButtonText

added in version 22.1.0
void setButtonText (String text)

Sets the button text.

Parameters
text String: The button text.

setDefaultBackground

added in version 22.1.0
void setDefaultBackground (boolean translucent)

Sets the default background.

Parameters
translucent boolean: True to set a translucent background.

setImageDrawable

added in version 22.1.0
void setImageDrawable (Drawable drawable)

Sets the drawable to be used for the error image.

Parameters
drawable Drawable: The drawable used for the error image.

setMessage

added in version 22.1.0
void setMessage (CharSequence message)

Sets the error message.

Parameters
message CharSequence: The error message.