public final class CarAppActivity
extends FragmentActivity

   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
           ↳ androidx.activity.ComponentActivity

The class representing a car app activity.

This class is responsible for binding to the host and rendering the content given by its CarAppService.

Usage of CarAppActivity is only required for applications targeting Automotive OS.

Activity Declaration

The app must declare and export this CarAppActivity in their manifest. In order for it to show up in the car's app launcher. It must declare the launchMode to be singleTask, and it must include a Intent.CATEGORY_LAUNCHER intent filter. For example:


     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   <meta-data android:name="distractionOptimized" android:value="true"/>

See CarAppService for how to declare your app's CarAppService in the manifest.

Distraction-optimized Activities

The activity must be the distractionOptimized meta-data set to true, in order for it to be displayed while driving. This is the only activity that can have this meta-data set to true, any other activities marked this way may cause the app to be rejected during app submission.


Inherited constants