CarToast

public final class CarToast
extends Object

java.lang.Object
   ↳ androidx.car.app.CarToast


A message to show to the user for a short period of time.

Summary

Constants

int LENGTH_LONG

Show the Toast view for a long period of time.

int LENGTH_SHORT

Show the Toast view for a short period of time.

Public methods

static CarToast makeText(CarContext carContext, int textResId, int duration)

Creates and sets the text and duration for the toast view.

static CarToast makeText(CarContext carContext, CharSequence text, int duration)

Creates and sets the text and duration for the toast view.

void setDuration(int duration)

Sets how long to show the toast for.

void setText(CharSequence text)

Sets the text for the toast.

void setText(int textResId)

Sets the text for the toast.

void show()

Shows the toast with the specified text for the specified duration.

Inherited methods