Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

CarUxRestrictionsHelper

open class CarUxRestrictionsHelper
kotlin.Any
   ↳ androidx.car.util.CarUxRestrictionsHelper

Helps registering OnUxRestrictionsChangedListener and managing car connection.

Summary

Public constructors

<init>(context: Context!, @NonNull listener: OnUxRestrictionsChangedListener)

Public methods

open Unit

Starts monitoring any changes in CarUxRestrictions.

open Unit

Stops monitoring any changes in CarUxRestrictions.

Public constructors

<init>

CarUxRestrictionsHelper(context: Context!, @NonNull listener: OnUxRestrictionsChangedListener)

Public methods

start

open fun start(): Unit

Starts monitoring any changes in CarUxRestrictions.

This method can be called from Activity's Activity#onStart(), or at the time of construction.

This method must be accompanied with a matching stop() to avoid leak.

stop

open fun stop(): Unit

Stops monitoring any changes in CarUxRestrictions.

This method should be called from Activity's Activity#onStop(), or at the time of being discarded.

After stop() has been called, start() can be called again to resume monitoring car ux restrictions change.