To add an OnboardingSupportFragment to your app, implement a class that extends the OnboardingSupportFragment class. Add this fragment to an activity, either via the activity's layout XML, or programmatically. Make sure the activity or fragment is using a theme derived from Theme_Leanback_Onboarding , as described in Customize themes . In the onCreate() method of your app's main activity, call startActivity() with an Intent that points to your OnboardingSupportFragment's parent activity. This ensures that your OnboardingSupportFragment appears as soon as your app starts. To ensure that the OnboardingSupportFragment only appears the first time that the user starts your app, use a SharedPreferences object to track whether the user has already viewed the OnboardingSupportFragment . Define a boolean value that changes to true when the user finishes viewing the ...
Introduce first-time users to your app To show a first-time user how to get the most from your app, present onboarding information at app startup. Here are some examples of onboarding information: Present detailed information on which channels are available when a user first accesses a channel app. Call attention to noteworthy features in your app. Illustrate any required or recommended steps that users should take when using the app for the first time. The Leanback androidx library provides the OnboardingSupportFragment class for presenting first-time user information. This lesson describes how to use the OnboardingSupportFragment class to present introductory information that is shown when the app launches for the first time. OnboardingSupportFragment uses TV UI best practices to present the information in a way that matches TV UI styles, and is easy to navigate on TV devices.