Android APIs
public class

ErrorFragment

extends Fragment
java.lang.Object
   ↳ android.app.Fragment
     ↳ android.support.v17.leanback.app.ErrorFragment

Class Overview

A fragment for displaying an error indication.

Summary

[Expand]
Inherited XML Attributes
From class android.app.Fragment
[Expand]
Inherited Constants
From interface android.content.ComponentCallbacks2
Public Constructors
ErrorFragment()
Public Methods
Drawable getBackgroundDrawable()
Returns the background drawable.
Drawable getBadgeDrawable()
Returns the badge drawable used in the fragment title.
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.
String getTitle()
Returns the title for the browse fragment.
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 setBadgeDrawable(Drawable drawable)
Sets the drawable displayed in the browse fragment title.
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.
void setTitle(String title)
Sets a title for the browse fragment.
[Expand]
Inherited Methods
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks

Public Constructors

public ErrorFragment ()

Public Methods

public Drawable getBackgroundDrawable ()

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

public Drawable getBadgeDrawable ()

Returns the badge drawable used in the fragment title.

public View.OnClickListener getButtonClickListener ()

Returns the button click listener.

public String getButtonText ()

Returns the button text.

public Drawable getImageDrawable ()

Returns the drawable used for the error image.

public CharSequence getMessage ()

Returns the error message.

public String getTitle ()

Returns the title for the browse fragment.

public boolean isBackgroundTranslucent ()

Returns true if the background is translucent.

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

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

public void setBackgroundDrawable (Drawable drawable)

Sets a drawable for the fragment background.

Parameters
drawable The drawable used for the background.

public void setBadgeDrawable (Drawable drawable)

Sets the drawable displayed in the browse fragment title.

Parameters
drawable The drawable to display in the browse fragment title.

public void setButtonClickListener (View.OnClickListener clickListener)

Set the button click listener.

Parameters
clickListener The click listener for the button.

public void setButtonText (String text)

Sets the button text.

Parameters
text The button text.

public void setDefaultBackground (boolean translucent)

Sets the default background.

Parameters
translucent True to set a translucent background.

public void setImageDrawable (Drawable drawable)

Sets the drawable to be used for the error image.

Parameters
drawable The drawable used for the error image.

public void setMessage (CharSequence message)

Sets the error message.

Parameters
message The error message.

public void setTitle (String title)

Sets a title for the browse fragment.

Parameters
title The title of the browse fragment.