Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
Android 0.0.0 Developer Preview
belongs to Maven artifact androidx.leanback:leanback:1.1.0-alpha01
Deprecated since version 0.0.0

ErrorFragment

public class ErrorFragment
extends BrandedFragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ androidx.leanback.app.BrandedFragment
       ↳ androidx.leanback.app.ErrorFragment


This class was deprecated in API level 0.0.0.
use ErrorSupportFragment

A fragment for displaying an error indication.

Summary

Inherited constants

Public constructors

ErrorFragment()

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)
void onStart()
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

Public constructors

ErrorFragment

public ErrorFragment ()

Public methods

getBackgroundDrawable

public Drawable getBackgroundDrawable ()

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

Returns
Drawable

getButtonClickListener

public View.OnClickListener getButtonClickListener ()

Returns the button click listener.

Returns
View.OnClickListener

getButtonText

public String getButtonText ()

Returns the button text.

Returns
String

getImageDrawable

public Drawable getImageDrawable ()

Returns the drawable used for the error image.

Returns
Drawable

getMessage

public CharSequence getMessage ()

Returns the error message.

Returns
CharSequence

isBackgroundTranslucent

public boolean isBackgroundTranslucent ()

Returns true if the background is translucent.

Returns
boolean

onCreateView

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

Parameters
inflater LayoutInflater

container ViewGroup

savedInstanceState Bundle

Returns
View

onStart

public void onStart ()

setBackgroundDrawable

public void setBackgroundDrawable (Drawable drawable)

Sets a drawable for the fragment background.

Parameters
drawable Drawable: The drawable used for the background.

setButtonClickListener

public void setButtonClickListener (View.OnClickListener clickListener)

Set the button click listener.

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

setButtonText

public void setButtonText (String text)

Sets the button text.

Parameters
text String: The button text.

setDefaultBackground

public void setDefaultBackground (boolean translucent)

Sets the default background.

Parameters
translucent boolean: True to set a translucent background.

setImageDrawable

public 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

public void setMessage (CharSequence message)

Sets the error message.

Parameters
message CharSequence: The error message.