leanback: make it friendly to deal with non AppCompat guided step

Add a ViewInflater to load a different View class in AppCompat theme,
so we won't get a warning logcat when using AppCompatEditText in none
AppCompat theme.

This is at the cost of slightly larger library size.

The GuidedActionEditText is changed back to EditText as parent.

Updated generatedv4.py and regenerated all source files.  Fixed
many NonNull/Nullable lint errors since the previous edit didn't run the
python script to auto generate code.  Updated different signature of
onCreateView and onSaveInstanceState for support library vs framework.

Test: added GuidedStepAppCompatActivity to support-leanback-demo app
Change-Id: Ic59e6144e3a5d1473fca1d34c90b7a6cfed76f2b
diff --git a/leanback/leanback/api/current.txt b/leanback/leanback/api/current.txt
index 6712e06..a9e0b33 100644
--- a/leanback/leanback/api/current.txt
+++ b/leanback/leanback/api/current.txt
@@ -46,27 +46,27 @@
 
   @Deprecated public class BrandedFragment extends android.app.Fragment {
     ctor @Deprecated public BrandedFragment();
-    method @Deprecated public android.graphics.drawable.Drawable! getBadgeDrawable();
+    method @Deprecated public android.graphics.drawable.Drawable? getBadgeDrawable();
     method @Deprecated public int getSearchAffordanceColor();
-    method @Deprecated public androidx.leanback.widget.SearchOrbView.Colors! getSearchAffordanceColors();
-    method @Deprecated public CharSequence! getTitle();
-    method @Deprecated public android.view.View! getTitleView();
-    method @Deprecated public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
-    method @Deprecated public void installTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public androidx.leanback.widget.SearchOrbView.Colors? getSearchAffordanceColors();
+    method @Deprecated public CharSequence? getTitle();
+    method @Deprecated public android.view.View? getTitleView();
+    method @Deprecated public androidx.leanback.widget.TitleViewAdapter? getTitleViewAdapter();
+    method @Deprecated public void installTitleView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle?);
     method @Deprecated public final boolean isShowingTitle();
     method @Deprecated public void onDestroyView();
-    method @Deprecated public android.view.View! onInflateTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View onInflateTitleView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
     method @Deprecated public void onPause();
     method @Deprecated public void onResume();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
     method @Deprecated public void onStart();
     method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
-    method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
-    method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener!);
+    method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable?);
+    method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener?);
     method @Deprecated public void setSearchAffordanceColor(int);
-    method @Deprecated public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
-    method @Deprecated public void setTitle(CharSequence!);
-    method @Deprecated public void setTitleView(android.view.View!);
+    method @Deprecated public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors);
+    method @Deprecated public void setTitle(CharSequence?);
+    method @Deprecated public void setTitleView(android.view.View?);
     method @Deprecated public void showTitle(boolean);
     method @Deprecated public void showTitle(int);
   }
@@ -112,7 +112,7 @@
     method @Deprecated public boolean isInHeadersTransition();
     method @Deprecated public boolean isShowingHeaders();
     method @Deprecated public androidx.leanback.app.HeadersFragment! onCreateHeadersFragment();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroy();
     method @Deprecated public void onStop();
     method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
@@ -302,7 +302,7 @@
     method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
     method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
     method @Deprecated protected android.view.View! inflateTitle(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated protected void onSetDetailsOverviewRowStatus(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, int, int);
     method @Deprecated protected void onSetRowStatus(androidx.leanback.widget.RowPresenter!, androidx.leanback.widget.RowPresenter.ViewHolder!, int, int, int);
     method @Deprecated public void onStop();
@@ -379,19 +379,19 @@
 
   @Deprecated public class ErrorFragment extends androidx.leanback.app.BrandedFragment {
     ctor @Deprecated public ErrorFragment();
-    method @Deprecated public android.graphics.drawable.Drawable! getBackgroundDrawable();
-    method @Deprecated public android.view.View.OnClickListener! getButtonClickListener();
-    method @Deprecated public String! getButtonText();
-    method @Deprecated public android.graphics.drawable.Drawable! getImageDrawable();
-    method @Deprecated public CharSequence! getMessage();
+    method @Deprecated public android.graphics.drawable.Drawable? getBackgroundDrawable();
+    method @Deprecated public android.view.View.OnClickListener? getButtonClickListener();
+    method @Deprecated public String? getButtonText();
+    method @Deprecated public android.graphics.drawable.Drawable? getImageDrawable();
+    method @Deprecated public CharSequence? getMessage();
     method @Deprecated public boolean isBackgroundTranslucent();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
-    method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener!);
-    method @Deprecated public void setButtonText(String!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
+    method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+    method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener?);
+    method @Deprecated public void setButtonText(String?);
     method @Deprecated public void setDefaultBackground(boolean);
-    method @Deprecated public void setImageDrawable(android.graphics.drawable.Drawable!);
-    method @Deprecated public void setMessage(CharSequence!);
+    method @Deprecated public void setImageDrawable(android.graphics.drawable.Drawable?);
+    method @Deprecated public void setMessage(CharSequence?);
   }
 
   public class ErrorSupportFragment extends androidx.leanback.app.BrandedSupportFragment {
@@ -412,26 +412,26 @@
 
   @Deprecated public class GuidedStepFragment extends android.app.Fragment {
     ctor @Deprecated public GuidedStepFragment();
-    method @Deprecated public static int add(android.app.FragmentManager!, androidx.leanback.app.GuidedStepFragment!);
-    method @Deprecated public static int add(android.app.FragmentManager!, androidx.leanback.app.GuidedStepFragment!, int);
-    method @Deprecated public static int addAsRoot(android.app.Activity!, androidx.leanback.app.GuidedStepFragment!, int);
+    method @Deprecated public static int add(android.app.FragmentManager, androidx.leanback.app.GuidedStepFragment);
+    method @Deprecated public static int add(android.app.FragmentManager, androidx.leanback.app.GuidedStepFragment, int);
+    method @Deprecated public static int addAsRoot(android.app.Activity, androidx.leanback.app.GuidedStepFragment, int);
     method @Deprecated public void collapseAction(boolean);
     method @Deprecated public void collapseSubActions();
-    method @Deprecated public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
-    method @Deprecated public void expandSubActions(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public androidx.leanback.widget.GuidedAction! findActionById(long);
+    method @Deprecated public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+    method @Deprecated public void expandSubActions(androidx.leanback.widget.GuidedAction);
+    method @Deprecated public androidx.leanback.widget.GuidedAction? findActionById(long);
     method @Deprecated public int findActionPositionById(long);
-    method @Deprecated public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
+    method @Deprecated public androidx.leanback.widget.GuidedAction? findButtonActionById(long);
     method @Deprecated public int findButtonActionPositionById(long);
     method @Deprecated public void finishGuidedStepFragments();
-    method @Deprecated public android.view.View! getActionItemView(int);
-    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!>! getActions();
-    method @Deprecated public android.view.View! getButtonActionItemView(int);
-    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!>! getButtonActions();
-    method @Deprecated public static androidx.leanback.app.GuidedStepFragment! getCurrentGuidedStepFragment(android.app.FragmentManager!);
-    method @Deprecated public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
+    method @Deprecated public android.view.View? getActionItemView(int);
+    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!> getActions();
+    method @Deprecated public android.view.View? getButtonActionItemView(int);
+    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!> getButtonActions();
+    method @Deprecated public static androidx.leanback.app.GuidedStepFragment? getCurrentGuidedStepFragment(android.app.FragmentManager);
+    method @Deprecated public androidx.leanback.widget.GuidanceStylist getGuidanceStylist();
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist getGuidedButtonActionsStylist();
     method @Deprecated public int getSelectedActionPosition();
     method @Deprecated public int getSelectedButtonActionPosition();
     method @Deprecated public int getUiStyle();
@@ -441,32 +441,32 @@
     method @Deprecated public boolean isSubActionsExpanded();
     method @Deprecated public void notifyActionChanged(int);
     method @Deprecated public void notifyButtonActionChanged(int);
-    method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction!, androidx.leanback.app.GuidedStepFragment!);
-    method @Deprecated public void onCreate(android.os.Bundle!);
-    method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
-    method @Deprecated public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
-    method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
-    method @Deprecated public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction, androidx.leanback.app.GuidedStepFragment);
+    method @Deprecated public void onCreate(android.os.Bundle?);
+    method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle?);
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
+    method @Deprecated public android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
+    method @Deprecated public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle?);
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist onCreateButtonActionsStylist();
+    method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle?);
+    method @Deprecated public androidx.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroyView();
-    method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
+    method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+    method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction);
     method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
+    method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction);
     method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
     method @Deprecated protected void onProvideFragmentTransitions();
     method @Deprecated public int onProvideTheme();
     method @Deprecated public void onResume();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
-    method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public void popBackStackToGuidedStepFragment(Class<?>!, int);
-    method @Deprecated public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
-    method @Deprecated public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>!);
-    method @Deprecated public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
+    method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+    method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction?);
+    method @Deprecated public void popBackStackToGuidedStepFragment(Class<?>, int);
+    method @Deprecated public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
+    method @Deprecated public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>?);
+    method @Deprecated public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
     method @Deprecated public void setSelectedActionPosition(int);
     method @Deprecated public void setSelectedButtonActionPosition(int);
     method @Deprecated public void setUiStyle(int);
@@ -547,7 +547,7 @@
     method @Deprecated public int getSelectedPosition();
     method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
     method @Deprecated public boolean isScrolling();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroyView();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
     method @Deprecated public void onTransitionEnd();
@@ -609,21 +609,21 @@
     method @Deprecated public final int getIconResourceId();
     method @Deprecated public final int getLogoResourceId();
     method @Deprecated protected abstract int getPageCount();
-    method @Deprecated protected abstract CharSequence! getPageDescription(int);
-    method @Deprecated protected abstract CharSequence! getPageTitle(int);
-    method @Deprecated public final CharSequence! getStartButtonText();
+    method @Deprecated protected abstract CharSequence? getPageDescription(int);
+    method @Deprecated protected abstract CharSequence? getPageTitle(int);
+    method @Deprecated public final CharSequence? getStartButtonText();
     method @Deprecated @ColorInt public final int getTitleViewTextColor();
     method @Deprecated protected final boolean isLogoAnimationFinished();
     method @Deprecated protected void moveToNextPage();
     method @Deprecated protected void moveToPreviousPage();
-    method @Deprecated protected abstract android.view.View? onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
-    method @Deprecated protected abstract android.view.View? onCreateContentView(android.view.LayoutInflater!, android.view.ViewGroup!);
-    method @Deprecated protected android.animation.Animator! onCreateDescriptionAnimator();
+    method @Deprecated protected abstract android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup);
+    method @Deprecated protected abstract android.view.View? onCreateContentView(android.view.LayoutInflater, android.view.ViewGroup);
+    method @Deprecated protected android.animation.Animator onCreateDescriptionAnimator();
     method @Deprecated protected android.animation.Animator? onCreateEnterAnimation();
-    method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
+    method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater, android.view.ViewGroup);
     method @Deprecated protected android.animation.Animator? onCreateLogoAnimation();
-    method @Deprecated protected android.animation.Animator! onCreateTitleAnimator();
-    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated protected android.animation.Animator onCreateTitleAnimator();
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated protected void onFinishFragment();
     method @Deprecated protected void onLogoAnimationFinished();
     method @Deprecated protected void onPageChanged(int, int);
@@ -636,7 +636,7 @@
     method @Deprecated public void setDotBackgroundColor(@ColorInt int);
     method @Deprecated public final void setIconResouceId(int);
     method @Deprecated public final void setLogoResourceId(int);
-    method @Deprecated public void setStartButtonText(CharSequence!);
+    method @Deprecated public void setStartButtonText(CharSequence?);
     method @Deprecated public void setTitleViewTextColor(@ColorInt int);
     method @Deprecated protected final void startEnterAnimation(boolean);
   }
@@ -694,7 +694,7 @@
     method @Deprecated public void notifyPlaybackRowChanged();
     method @Deprecated protected void onBufferingStateChanged(boolean);
     method @Deprecated public void onCreate(android.os.Bundle!);
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroy();
     method @Deprecated public void onDestroyView();
     method @Deprecated protected void onError(int, CharSequence!);
@@ -803,7 +803,7 @@
     method @Deprecated public int getSelectedPosition();
     method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
     method @Deprecated public boolean isScrolling();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroyView();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
     method @Deprecated public void onTransitionEnd();
@@ -881,7 +881,7 @@
     method @Deprecated public String! getTitle();
     method @Deprecated public static androidx.leanback.app.SearchFragment! newInstance(String!);
     method @Deprecated public void onCreate(android.os.Bundle!);
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroy();
     method @Deprecated public void onDestroyView();
     method @Deprecated public void onPause();
@@ -939,14 +939,14 @@
 
   @Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
     ctor @Deprecated public VerticalGridFragment();
-    method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
-    method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
-    method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
-    method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter!);
-    method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
-    method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
+    method @Deprecated public androidx.leanback.widget.ObjectAdapter? getAdapter();
+    method @Deprecated public androidx.leanback.widget.VerticalGridPresenter? getGridPresenter();
+    method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener? getOnItemViewClickedListener();
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
+    method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter?);
+    method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter);
+    method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener?);
+    method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener?);
     method @Deprecated public void setSelectedPosition(int);
   }
 
@@ -1883,6 +1883,14 @@
     method public B! title(CharSequence?);
   }
 
+  public class GuidedActionAppCompatEditText extends androidx.appcompat.widget.AppCompatEditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
+    ctor public GuidedActionAppCompatEditText(android.content.Context);
+    ctor public GuidedActionAppCompatEditText(android.content.Context, android.util.AttributeSet?);
+    ctor public GuidedActionAppCompatEditText(android.content.Context, android.util.AttributeSet?, int);
+    method public void setImeKeyListener(androidx.leanback.widget.ImeKeyMonitor.ImeKeyListener?);
+    method public void setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener?);
+  }
+
   public interface GuidedActionAutofillSupport {
     method public void setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener!);
   }
@@ -1898,7 +1906,7 @@
     method public static androidx.leanback.widget.GuidedActionDiffCallback getInstance();
   }
 
-  public class GuidedActionEditText extends androidx.appcompat.widget.AppCompatEditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
+  public class GuidedActionEditText extends android.widget.EditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
     ctor public GuidedActionEditText(android.content.Context!);
     ctor public GuidedActionEditText(android.content.Context!, android.util.AttributeSet!);
     ctor public GuidedActionEditText(android.content.Context!, android.util.AttributeSet!, int);
@@ -2113,6 +2121,10 @@
     method public void wrap(android.view.View!, android.view.View!);
   }
 
+  public class LeanbackAppCompatViewInflater extends androidx.appcompat.app.AppCompatViewInflater {
+    ctor public LeanbackAppCompatViewInflater();
+  }
+
   public class ListRow extends androidx.leanback.widget.Row {
     ctor public ListRow(androidx.leanback.widget.HeaderItem!, androidx.leanback.widget.ObjectAdapter!);
     ctor public ListRow(androidx.leanback.widget.ObjectAdapter!);
diff --git a/leanback/leanback/api/restricted_current.txt b/leanback/leanback/api/restricted_current.txt
index 7c962a9e..69d9df6 100644
--- a/leanback/leanback/api/restricted_current.txt
+++ b/leanback/leanback/api/restricted_current.txt
@@ -68,27 +68,27 @@
 
   @Deprecated public class BrandedFragment extends android.app.Fragment {
     ctor @Deprecated public BrandedFragment();
-    method @Deprecated public android.graphics.drawable.Drawable! getBadgeDrawable();
+    method @Deprecated public android.graphics.drawable.Drawable? getBadgeDrawable();
     method @Deprecated public int getSearchAffordanceColor();
-    method @Deprecated public androidx.leanback.widget.SearchOrbView.Colors! getSearchAffordanceColors();
-    method @Deprecated public CharSequence! getTitle();
-    method @Deprecated public android.view.View! getTitleView();
-    method @Deprecated public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
-    method @Deprecated public void installTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public androidx.leanback.widget.SearchOrbView.Colors? getSearchAffordanceColors();
+    method @Deprecated public CharSequence? getTitle();
+    method @Deprecated public android.view.View? getTitleView();
+    method @Deprecated public androidx.leanback.widget.TitleViewAdapter? getTitleViewAdapter();
+    method @Deprecated public void installTitleView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle?);
     method @Deprecated public final boolean isShowingTitle();
     method @Deprecated public void onDestroyView();
-    method @Deprecated public android.view.View! onInflateTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View onInflateTitleView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
     method @Deprecated public void onPause();
     method @Deprecated public void onResume();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
     method @Deprecated public void onStart();
     method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
-    method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
-    method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener!);
+    method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable?);
+    method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener?);
     method @Deprecated public void setSearchAffordanceColor(int);
-    method @Deprecated public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
-    method @Deprecated public void setTitle(CharSequence!);
-    method @Deprecated public void setTitleView(android.view.View!);
+    method @Deprecated public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors);
+    method @Deprecated public void setTitle(CharSequence?);
+    method @Deprecated public void setTitleView(android.view.View?);
     method @Deprecated public void showTitle(boolean);
     method @Deprecated public void showTitle(int);
   }
@@ -134,7 +134,7 @@
     method @Deprecated public boolean isInHeadersTransition();
     method @Deprecated public boolean isShowingHeaders();
     method @Deprecated public androidx.leanback.app.HeadersFragment! onCreateHeadersFragment();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroy();
     method @Deprecated public void onStop();
     method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
@@ -324,7 +324,7 @@
     method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
     method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
     method @Deprecated protected android.view.View! inflateTitle(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated protected void onSetDetailsOverviewRowStatus(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, int, int);
     method @Deprecated protected void onSetRowStatus(androidx.leanback.widget.RowPresenter!, androidx.leanback.widget.RowPresenter.ViewHolder!, int, int, int);
     method @Deprecated public void onStop();
@@ -401,19 +401,19 @@
 
   @Deprecated public class ErrorFragment extends androidx.leanback.app.BrandedFragment {
     ctor @Deprecated public ErrorFragment();
-    method @Deprecated public android.graphics.drawable.Drawable! getBackgroundDrawable();
-    method @Deprecated public android.view.View.OnClickListener! getButtonClickListener();
-    method @Deprecated public String! getButtonText();
-    method @Deprecated public android.graphics.drawable.Drawable! getImageDrawable();
-    method @Deprecated public CharSequence! getMessage();
+    method @Deprecated public android.graphics.drawable.Drawable? getBackgroundDrawable();
+    method @Deprecated public android.view.View.OnClickListener? getButtonClickListener();
+    method @Deprecated public String? getButtonText();
+    method @Deprecated public android.graphics.drawable.Drawable? getImageDrawable();
+    method @Deprecated public CharSequence? getMessage();
     method @Deprecated public boolean isBackgroundTranslucent();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
-    method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener!);
-    method @Deprecated public void setButtonText(String!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
+    method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
+    method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener?);
+    method @Deprecated public void setButtonText(String?);
     method @Deprecated public void setDefaultBackground(boolean);
-    method @Deprecated public void setImageDrawable(android.graphics.drawable.Drawable!);
-    method @Deprecated public void setMessage(CharSequence!);
+    method @Deprecated public void setImageDrawable(android.graphics.drawable.Drawable?);
+    method @Deprecated public void setMessage(CharSequence?);
   }
 
   public class ErrorSupportFragment extends androidx.leanback.app.BrandedSupportFragment {
@@ -434,26 +434,26 @@
 
   @Deprecated public class GuidedStepFragment extends android.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
     ctor @Deprecated public GuidedStepFragment();
-    method @Deprecated public static int add(android.app.FragmentManager!, androidx.leanback.app.GuidedStepFragment!);
-    method @Deprecated public static int add(android.app.FragmentManager!, androidx.leanback.app.GuidedStepFragment!, int);
-    method @Deprecated public static int addAsRoot(android.app.Activity!, androidx.leanback.app.GuidedStepFragment!, int);
+    method @Deprecated public static int add(android.app.FragmentManager, androidx.leanback.app.GuidedStepFragment);
+    method @Deprecated public static int add(android.app.FragmentManager, androidx.leanback.app.GuidedStepFragment, int);
+    method @Deprecated public static int addAsRoot(android.app.Activity, androidx.leanback.app.GuidedStepFragment, int);
     method @Deprecated public void collapseAction(boolean);
     method @Deprecated public void collapseSubActions();
-    method @Deprecated public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
-    method @Deprecated public void expandSubActions(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public androidx.leanback.widget.GuidedAction! findActionById(long);
+    method @Deprecated public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+    method @Deprecated public void expandSubActions(androidx.leanback.widget.GuidedAction);
+    method @Deprecated public androidx.leanback.widget.GuidedAction? findActionById(long);
     method @Deprecated public int findActionPositionById(long);
-    method @Deprecated public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
+    method @Deprecated public androidx.leanback.widget.GuidedAction? findButtonActionById(long);
     method @Deprecated public int findButtonActionPositionById(long);
     method @Deprecated public void finishGuidedStepFragments();
-    method @Deprecated public android.view.View! getActionItemView(int);
-    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!>! getActions();
-    method @Deprecated public android.view.View! getButtonActionItemView(int);
-    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!>! getButtonActions();
-    method @Deprecated public static androidx.leanback.app.GuidedStepFragment! getCurrentGuidedStepFragment(android.app.FragmentManager!);
-    method @Deprecated public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
+    method @Deprecated public android.view.View? getActionItemView(int);
+    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!> getActions();
+    method @Deprecated public android.view.View? getButtonActionItemView(int);
+    method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction!> getButtonActions();
+    method @Deprecated public static androidx.leanback.app.GuidedStepFragment? getCurrentGuidedStepFragment(android.app.FragmentManager);
+    method @Deprecated public androidx.leanback.widget.GuidanceStylist getGuidanceStylist();
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist getGuidedButtonActionsStylist();
     method @Deprecated public int getSelectedActionPosition();
     method @Deprecated public int getSelectedButtonActionPosition();
     method @Deprecated public int getUiStyle();
@@ -463,32 +463,32 @@
     method @Deprecated public boolean isSubActionsExpanded();
     method @Deprecated public void notifyActionChanged(int);
     method @Deprecated public void notifyButtonActionChanged(int);
-    method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction!, androidx.leanback.app.GuidedStepFragment!);
-    method @Deprecated public void onCreate(android.os.Bundle!);
-    method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
-    method @Deprecated public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
-    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
-    method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
-    method @Deprecated public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction, androidx.leanback.app.GuidedStepFragment);
+    method @Deprecated public void onCreate(android.os.Bundle?);
+    method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle?);
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
+    method @Deprecated public android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
+    method @Deprecated public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle?);
+    method @Deprecated public androidx.leanback.widget.GuidedActionsStylist onCreateButtonActionsStylist();
+    method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle?);
+    method @Deprecated public androidx.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroyView();
-    method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
+    method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+    method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction);
     method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
+    method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction);
     method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
     method @Deprecated protected void onProvideFragmentTransitions();
     method @Deprecated public int onProvideTheme();
     method @Deprecated public void onResume();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
-    method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction!);
-    method @Deprecated public void popBackStackToGuidedStepFragment(Class<?>!, int);
-    method @Deprecated public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
-    method @Deprecated public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>!);
-    method @Deprecated public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
+    method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+    method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction?);
+    method @Deprecated public void popBackStackToGuidedStepFragment(Class<?>, int);
+    method @Deprecated public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
+    method @Deprecated public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>?);
+    method @Deprecated public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
     method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEntranceTransitionType(int);
     method @Deprecated public void setSelectedActionPosition(int);
     method @Deprecated public void setSelectedButtonActionPosition(int);
@@ -504,7 +504,7 @@
 
   @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class GuidedStepFragment.DummyFragment extends android.app.Fragment {
     ctor @Deprecated public GuidedStepFragment.DummyFragment();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
   }
 
   public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
@@ -584,7 +584,7 @@
     method @Deprecated public int getSelectedPosition();
     method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
     method @Deprecated public boolean isScrolling();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroyView();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
     method @Deprecated public void onTransitionEnd();
@@ -646,21 +646,21 @@
     method @Deprecated public final int getIconResourceId();
     method @Deprecated public final int getLogoResourceId();
     method @Deprecated protected abstract int getPageCount();
-    method @Deprecated protected abstract CharSequence! getPageDescription(int);
-    method @Deprecated protected abstract CharSequence! getPageTitle(int);
-    method @Deprecated public final CharSequence! getStartButtonText();
+    method @Deprecated protected abstract CharSequence? getPageDescription(int);
+    method @Deprecated protected abstract CharSequence? getPageTitle(int);
+    method @Deprecated public final CharSequence? getStartButtonText();
     method @Deprecated @ColorInt public final int getTitleViewTextColor();
     method @Deprecated protected final boolean isLogoAnimationFinished();
     method @Deprecated protected void moveToNextPage();
     method @Deprecated protected void moveToPreviousPage();
-    method @Deprecated protected abstract android.view.View? onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
-    method @Deprecated protected abstract android.view.View? onCreateContentView(android.view.LayoutInflater!, android.view.ViewGroup!);
-    method @Deprecated protected android.animation.Animator! onCreateDescriptionAnimator();
+    method @Deprecated protected abstract android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup);
+    method @Deprecated protected abstract android.view.View? onCreateContentView(android.view.LayoutInflater, android.view.ViewGroup);
+    method @Deprecated protected android.animation.Animator onCreateDescriptionAnimator();
     method @Deprecated protected android.animation.Animator? onCreateEnterAnimation();
-    method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
+    method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater, android.view.ViewGroup);
     method @Deprecated protected android.animation.Animator? onCreateLogoAnimation();
-    method @Deprecated protected android.animation.Animator! onCreateTitleAnimator();
-    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated protected android.animation.Animator onCreateTitleAnimator();
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated protected void onFinishFragment();
     method @Deprecated protected void onLogoAnimationFinished();
     method @Deprecated protected void onPageChanged(int, int);
@@ -673,7 +673,7 @@
     method @Deprecated public void setDotBackgroundColor(@ColorInt int);
     method @Deprecated public final void setIconResouceId(int);
     method @Deprecated public final void setLogoResourceId(int);
-    method @Deprecated public void setStartButtonText(CharSequence!);
+    method @Deprecated public void setStartButtonText(CharSequence?);
     method @Deprecated public void setTitleViewTextColor(@ColorInt int);
     method @Deprecated protected final void startEnterAnimation(boolean);
   }
@@ -735,7 +735,7 @@
     method @Deprecated public void notifyPlaybackRowChanged();
     method @Deprecated protected void onBufferingStateChanged(boolean);
     method @Deprecated public void onCreate(android.os.Bundle!);
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroy();
     method @Deprecated public void onDestroyView();
     method @Deprecated protected void onError(int, CharSequence!);
@@ -844,7 +844,7 @@
     method @Deprecated public int getSelectedPosition();
     method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
     method @Deprecated public boolean isScrolling();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroyView();
     method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
     method @Deprecated public void onTransitionEnd();
@@ -922,7 +922,7 @@
     method @Deprecated public String! getTitle();
     method @Deprecated public static androidx.leanback.app.SearchFragment! newInstance(String!);
     method @Deprecated public void onCreate(android.os.Bundle!);
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
     method @Deprecated public void onDestroy();
     method @Deprecated public void onDestroyView();
     method @Deprecated public void onPause();
@@ -980,14 +980,14 @@
 
   @Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
     ctor @Deprecated public VerticalGridFragment();
-    method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
-    method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
-    method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
-    method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
-    method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
-    method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter!);
-    method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
-    method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
+    method @Deprecated public androidx.leanback.widget.ObjectAdapter? getAdapter();
+    method @Deprecated public androidx.leanback.widget.VerticalGridPresenter? getGridPresenter();
+    method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener? getOnItemViewClickedListener();
+    method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup?, android.os.Bundle!);
+    method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter?);
+    method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter);
+    method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener?);
+    method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener?);
     method @Deprecated public void setSelectedPosition(int);
   }
 
@@ -2090,6 +2090,14 @@
     method public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener?);
   }
 
+  public class GuidedActionAppCompatEditText extends androidx.appcompat.widget.AppCompatEditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
+    ctor public GuidedActionAppCompatEditText(android.content.Context);
+    ctor public GuidedActionAppCompatEditText(android.content.Context, android.util.AttributeSet?);
+    ctor public GuidedActionAppCompatEditText(android.content.Context, android.util.AttributeSet?, int);
+    method public void setImeKeyListener(androidx.leanback.widget.ImeKeyMonitor.ImeKeyListener?);
+    method public void setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener?);
+  }
+
   public interface GuidedActionAutofillSupport {
     method public void setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener!);
   }
@@ -2105,7 +2113,7 @@
     method public static androidx.leanback.widget.GuidedActionDiffCallback getInstance();
   }
 
-  public class GuidedActionEditText extends androidx.appcompat.widget.AppCompatEditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
+  public class GuidedActionEditText extends android.widget.EditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
     ctor public GuidedActionEditText(android.content.Context!);
     ctor public GuidedActionEditText(android.content.Context!, android.util.AttributeSet!);
     ctor public GuidedActionEditText(android.content.Context!, android.util.AttributeSet!, int);
@@ -2326,6 +2334,10 @@
     method public void wrap(android.view.View!, android.view.View!);
   }
 
+  public class LeanbackAppCompatViewInflater extends androidx.appcompat.app.AppCompatViewInflater {
+    ctor public LeanbackAppCompatViewInflater();
+  }
+
   public class ListRow extends androidx.leanback.widget.Row {
     ctor public ListRow(androidx.leanback.widget.HeaderItem!, androidx.leanback.widget.ObjectAdapter!);
     ctor public ListRow(androidx.leanback.widget.ObjectAdapter!);
diff --git a/leanback/leanback/generatef.py b/leanback/leanback/generatef.py
index bb38d96..64dab43 100755
--- a/leanback/leanback/generatef.py
+++ b/leanback/leanback/generatef.py
@@ -18,14 +18,14 @@
 import sys
 import re
 
-print "Generate framework fragment related code for leanback"
+print("Generate framework fragment related code for leanback")
 
 cls = ['Base', 'BaseRow', 'Browse', 'Details', 'Error', 'Headers',
       'Playback', 'Rows', 'Search', 'VerticalGrid', 'Branded',
       'GuidedStep', 'Onboarding', 'Video']
 
 for w in cls:
-    print "copy {}SupportFragment to {}Fragment".format(w, w)
+    print("copy {}SupportFragment to {}Fragment".format(w, w))
 
     file = open('src/main/java/androidx/leanback/app/{}SupportFragment.java'.format(w), 'r')
     content = "// CHECKSTYLE:OFF Generated code\n"
@@ -45,10 +45,22 @@
         line = line.replace('setSharedElementEnterTransition(sharedElementTransition)', 'setSharedElementEnterTransition((android.transition.Transition) sharedElementTransition)');
         line = line.replace('setExitTransition(exitTransition)', 'setExitTransition((android.transition.Transition) exitTransition)');
         line = line.replace('requestPermissions(new', 'PermissionHelper.requestPermissions(SearchFragment.this, new');
+
         # replace getContext() with FragmentUtil.getContext(XXXFragment.this), but dont match the case "view.getContext()"
         line = re.sub(r'([^\.])getContext\(\)', r'\1FragmentUtil.getContext({}Fragment.this)'.format(w), line);
         content = content + line
     file.close()
+
+    # treat different Nullable for onCreateView
+    content = re.sub(
+        'View onCreateView\(@NonNull LayoutInflater ([a-zA-Z]+),\s*@Nullable ViewGroup ([a-zA-Z]+),\s*@Nullable Bundle ([a-zA-Z]+)',
+        r'View onCreateView(LayoutInflater \1, @Nullable ViewGroup \2, Bundle \3', content)
+
+    # treat different Nullable for onSaveInstance
+    content = re.sub(
+        'void onSaveInstanceState\(@NonNull Bundle ([a-zA-Z]+)\)',
+        r'void onSaveInstanceState(Bundle \1)', content)
+
     # add deprecated tag to fragment class and inner classes/interfaces
     content = re.sub(r'\*\/\n(@.*\n|)(public |abstract public |abstract |)class', '* @deprecated use {@link ' + w + 'SupportFragment}\n */\n@Deprecated\n\\1\\2class', content)
     content = re.sub(r'\*\/\n    public (static class|interface|final static class|abstract static class)', '* @deprecated use {@link ' + w + 'SupportFragment}\n     */\n    @Deprecated\n    public \\1', content)
@@ -58,7 +70,7 @@
 
 
 
-print "copy VideoSupportFragmentGlueHost to VideoFragmentGlueHost"
+print("copy VideoSupportFragmentGlueHost to VideoFragmentGlueHost")
 file = open('src/main/java/androidx/leanback/app/VideoSupportFragmentGlueHost.java', 'r')
 content = "// CHECKSTYLE:OFF Generated code\n"
 content = content + "/* This file is auto-generated from VideoSupportFragmentGlueHost.java.  DO NOT MODIFY. */\n\n"
@@ -76,7 +88,7 @@
 
 
 
-print "copy PlaybackSupportFragmentGlueHost to PlaybackFragmentGlueHost"
+print("copy PlaybackSupportFragmentGlueHost to PlaybackFragmentGlueHost")
 file = open('src/main/java/androidx/leanback/app/PlaybackSupportFragmentGlueHost.java', 'r')
 content = "// CHECKSTYLE:OFF Generated code\n"
 content = content + "/* This file is auto-generated from {}PlaybackSupportFragmentGlueHost.java.  DO NOT MODIFY. */\n\n"
@@ -94,7 +106,7 @@
 
 
 
-print "copy DetailsSupportFragmentBackgroundController to DetailsFragmentBackgroundController"
+print("copy DetailsSupportFragmentBackgroundController to DetailsFragmentBackgroundController")
 file = open('src/main/java/androidx/leanback/app/DetailsSupportFragmentBackgroundController.java', 'r')
 content = "// CHECKSTYLE:OFF Generated code\n"
 content = content + "/* This file is auto-generated from {}DetailsSupportFragmentBackgroundController.java.  DO NOT MODIFY. */\n\n"
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowFragment.java
index 4f512da..873c50a 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowFragment.java
@@ -67,8 +67,8 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         View view = inflater.inflate(getLayoutResourceId(), container, false);
         mVerticalGridView = findGridViewFromRoot(view);
         if (mPendingTransitionPrepare) {
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowSupportFragment.java
index 7835125..de9ab85 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/BaseRowSupportFragment.java
@@ -62,8 +62,9 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+            @Nullable Bundle savedInstanceState) {
         View view = inflater.inflate(getLayoutResourceId(), container, false);
         mVerticalGridView = findGridViewFromRoot(view);
         if (mPendingTransitionPrepare) {
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/BrandedFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/BrandedFragment.java
index 35bd583..9808ba9f 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/BrandedFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/BrandedFragment.java
@@ -65,12 +65,13 @@
      * @param savedInstanceState If non-null, this fragment is being re-constructed
      *                           from a previous saved state as given here.
      * @return Title view which must have a descendant with id browse_title_group that implements
-     *         {@link TitleViewAdapter.Provider}, or null for no title view.
+     * {@link TitleViewAdapter.Provider}, or null for no title view.
      */
-    public View onInflateTitleView(LayoutInflater inflater, ViewGroup parent,
-                                Bundle savedInstanceState) {
+    @NonNull
+    public View onInflateTitleView(@NonNull LayoutInflater inflater, @Nullable ViewGroup parent,
+            @Nullable Bundle savedInstanceState) {
         TypedValue typedValue = new TypedValue();
-        boolean found = parent.getContext().getTheme().resolveAttribute(
+        boolean found = parent != null && parent.getContext().getTheme().resolveAttribute(
                 R.attr.browseTitleViewLayout, typedValue, true);
         return inflater.inflate(found ? typedValue.resourceId : R.layout.lb_browse_title,
                 parent, false);
@@ -85,8 +86,8 @@
      * @param savedInstanceState If non-null, this fragment is being re-constructed
      * from a previous saved state as given here.
      */
-    public void installTitleView(LayoutInflater inflater, ViewGroup parent,
-                            Bundle savedInstanceState) {
+    public void installTitleView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent,
+            @Nullable Bundle savedInstanceState) {
         View titleLayoutRoot = onInflateTitleView(inflater, parent, savedInstanceState);
         if (titleLayoutRoot != null) {
             parent.addView(titleLayoutRoot);
@@ -100,7 +101,7 @@
      * Sets the view that implemented {@link TitleViewAdapter}.
      * @param titleView The view that implemented {@link TitleViewAdapter.Provider}.
      */
-    public void setTitleView(View titleView) {
+    public void setTitleView(@Nullable View titleView) {
         mTitleView = titleView;
         if (mTitleView == null) {
             mTitleViewAdapter = null;
@@ -125,6 +126,7 @@
      * Returns the view that implements {@link TitleViewAdapter.Provider}.
      * @return The view that implements {@link TitleViewAdapter.Provider}.
      */
+    @Nullable
     public View getTitleView() {
         return mTitleView;
     }
@@ -133,6 +135,7 @@
      * Returns the {@link TitleViewAdapter} implemented by title view.
      * @return The {@link TitleViewAdapter} implemented by title view.
      */
+    @Nullable
     public TitleViewAdapter getTitleViewAdapter() {
         return mTitleViewAdapter;
     }
@@ -205,7 +208,7 @@
      *
      * @param drawable The Drawable to display in the fragment title.
      */
-    public void setBadgeDrawable(Drawable drawable) {
+    public void setBadgeDrawable(@Nullable Drawable drawable) {
         if (mBadgeDrawable != drawable) {
             mBadgeDrawable = drawable;
             if (mTitleViewAdapter != null) {
@@ -218,6 +221,7 @@
      * Returns the badge drawable used in the fragment title.
      * @return The badge drawable used in the fragment title.
      */
+    @Nullable
     public Drawable getBadgeDrawable() {
         return mBadgeDrawable;
     }
@@ -227,7 +231,7 @@
      *
      * @param title The title text of the fragment.
      */
-    public void setTitle(CharSequence title) {
+    public void setTitle(@Nullable CharSequence title) {
         mTitle = title;
         if (mTitleViewAdapter != null) {
             mTitleViewAdapter.setTitle(title);
@@ -238,6 +242,7 @@
      * Returns the title text for the fragment.
      * @return Title text for the fragment.
      */
+    @Nullable
     public CharSequence getTitle() {
         return mTitle;
     }
@@ -254,7 +259,7 @@
      *
      * @param listener The listener to call when the search element is clicked.
      */
-    public void setOnSearchClickedListener(View.OnClickListener listener) {
+    public void setOnSearchClickedListener(@Nullable View.OnClickListener listener) {
         mExternalOnSearchClickedListener = listener;
         if (mTitleViewAdapter != null) {
             mTitleViewAdapter.setOnSearchClickedListener(listener);
@@ -267,7 +272,7 @@
      *
      * @param colors Colors used to draw search affordance.
      */
-    public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
+    public void setSearchAffordanceColors(@NonNull SearchOrbView.Colors colors) {
         mSearchAffordanceColors = colors;
         mSearchAffordanceColorSet = true;
         if (mTitleViewAdapter != null) {
@@ -279,6 +284,7 @@
      * Returns the {@link androidx.leanback.widget.SearchOrbView.Colors}
      * used to draw the search affordance.
      */
+    @Nullable
     public SearchOrbView.Colors getSearchAffordanceColors() {
         if (mSearchAffordanceColorSet) {
             return mSearchAffordanceColors;
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java
index b9d9bce..66303bc 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java
@@ -1269,8 +1269,8 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
 
         if (getChildFragmentManager().findFragmentById(R.id.scale_frame) == null) {
             mHeadersFragment = onCreateHeadersFragment();
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java
index 2bf7689..d37752d 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java
@@ -1246,8 +1246,9 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+            @Nullable Bundle savedInstanceState) {
 
         if (getChildFragmentManager().findFragmentById(R.id.scale_frame) == null) {
             mHeadersSupportFragment = onCreateHeadersSupportFragment();
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java
index fd91afb..bf621a7 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java
@@ -31,6 +31,8 @@
 import android.view.Window;
 
 import androidx.annotation.CallSuper;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import android.app.Fragment;
 import android.app.Activity;
 import android.app.FragmentTransaction;
@@ -477,8 +479,8 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         mRootView = (BrowseFrameLayout) inflater.inflate(
                 R.layout.lb_details_fragment, container, false);
         mBackgroundView = mRootView.findViewById(R.id.details_background_view);
@@ -539,7 +541,7 @@
     }
 
     /**
-     * @deprecated override {@link #onInflateTitleView(LayoutInflater,ViewGroup,Bundle)} instead.
+     * @deprecated override {@link BrandedFragment#onInflateTitleView(LayoutInflater, ViewGroup, Bundle)} instead.
      */
     @Deprecated
     protected View inflateTitle(LayoutInflater inflater, ViewGroup parent,
@@ -548,8 +550,11 @@
     }
 
     @Override
-    public View onInflateTitleView(LayoutInflater inflater, ViewGroup parent,
-                                   Bundle savedInstanceState) {
+    public @NonNull View onInflateTitleView(
+            @NonNull LayoutInflater inflater,
+            @Nullable ViewGroup parent,
+            @Nullable Bundle savedInstanceState
+    ) {
         return inflateTitle(inflater, parent, savedInstanceState);
     }
 
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java
index f0c5a49..fa4c82b 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java
@@ -474,8 +474,9 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+            @Nullable Bundle savedInstanceState) {
         mRootView = (BrowseFrameLayout) inflater.inflate(
                 R.layout.lb_details_fragment, container, false);
         mBackgroundView = mRootView.findViewById(R.id.details_background_view);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/ErrorFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/ErrorFragment.java
index 71d146c..d887e5f 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/ErrorFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/ErrorFragment.java
@@ -29,6 +29,8 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.leanback.R;
 
 /**
@@ -73,7 +75,7 @@
      *
      * @param drawable The drawable used for the background.
      */
-    public void setBackgroundDrawable(Drawable drawable) {
+    public void setBackgroundDrawable(@Nullable Drawable drawable) {
         mBackgroundDrawable = drawable;
         if (drawable != null) {
             final int opacity = drawable.getOpacity();
@@ -87,6 +89,7 @@
     /**
      * Returns the background drawable.  May be null if a default is used.
      */
+    @Nullable
     public Drawable getBackgroundDrawable() {
         return mBackgroundDrawable;
     }
@@ -96,7 +99,7 @@
      *
      * @param drawable The drawable used for the error image.
      */
-    public void setImageDrawable(Drawable drawable) {
+    public void setImageDrawable(@Nullable Drawable drawable) {
         mDrawable = drawable;
         updateImageDrawable();
     }
@@ -104,6 +107,7 @@
     /**
      * Returns the drawable used for the error image.
      */
+    @Nullable
     public Drawable getImageDrawable() {
         return mDrawable;
     }
@@ -113,7 +117,7 @@
      *
      * @param message The error message.
      */
-    public void setMessage(CharSequence message) {
+    public void setMessage(@Nullable CharSequence message) {
         mMessage = message;
         updateMessage();
     }
@@ -121,6 +125,7 @@
     /**
      * Returns the error message.
      */
+    @Nullable
     public CharSequence getMessage() {
         return mMessage;
     }
@@ -130,7 +135,7 @@
      *
      * @param text The button text.
      */
-    public void setButtonText(String text) {
+    public void setButtonText(@Nullable String text) {
         mButtonText = text;
         updateButton();
     }
@@ -138,6 +143,7 @@
     /**
      * Returns the button text.
      */
+    @Nullable
     public String getButtonText() {
         return mButtonText;
     }
@@ -147,7 +153,7 @@
      *
      * @param clickListener The click listener for the button.
      */
-    public void setButtonClickListener(View.OnClickListener clickListener) {
+    public void setButtonClickListener(@Nullable View.OnClickListener clickListener) {
         mButtonClickListener = clickListener;
         updateButton();
     }
@@ -155,13 +161,14 @@
     /**
      * Returns the button click listener.
      */
+    @Nullable
     public View.OnClickListener getButtonClickListener() {
         return mButtonClickListener;
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         View root = inflater.inflate(R.layout.lb_error_fragment, container, false);
 
         mErrorFrame = (ViewGroup) root.findViewById(R.id.error_frame);
@@ -179,12 +186,18 @@
         updateButton();
 
         FontMetricsInt metrics = getFontMetricsInt(mTextView);
-        int underImageBaselineMargin = container.getResources().getDimensionPixelSize(
-                R.dimen.lb_error_under_image_baseline_margin);
+        int underImageBaselineMargin = 0;
+        if (container != null) {
+            underImageBaselineMargin = container.getResources().getDimensionPixelSize(
+                    R.dimen.lb_error_under_image_baseline_margin);
+        }
         setTopMargin(mTextView, underImageBaselineMargin + metrics.ascent);
 
-        int underMessageBaselineMargin = container.getResources().getDimensionPixelSize(
-                R.dimen.lb_error_under_message_baseline_margin);
+        int underMessageBaselineMargin = 0;
+        if (container != null) {
+            underMessageBaselineMargin = container.getResources().getDimensionPixelSize(
+                    R.dimen.lb_error_under_message_baseline_margin);
+        }
         setTopMargin(mButton, underMessageBaselineMargin - metrics.descent);
 
         return root;
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/ErrorSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/ErrorSupportFragment.java
index b948fa1..e1afe1e 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/ErrorSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/ErrorSupportFragment.java
@@ -161,8 +161,8 @@
         return mButtonClickListener;
     }
 
-    @NonNull
     @Override
+    @Nullable
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
             @Nullable Bundle savedInstanceState) {
         View root = inflater.inflate(R.layout.lb_error_fragment, container, false);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
index 0d42f51..031433f9 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
@@ -34,6 +34,7 @@
 import android.widget.LinearLayout;
 
 import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.annotation.RestrictTo;
 import androidx.core.app.ActivityCompat;
 import android.app.Fragment;
@@ -144,8 +145,8 @@
  * @see GuidedActionsStylist
  * @deprecated use {@link GuidedStepSupportFragment}
  */
-@SuppressWarnings("HiddenSuperclass")
 @Deprecated
+@SuppressWarnings("HiddenSuperclass")
 public class GuidedStepFragment extends Fragment implements GuidedActionAdapter.FocusListener {
 
     private static final String TAG_LEAN_BACK_ACTIONS_FRAGMENT = "leanBackGuidedStepFragment";
@@ -247,9 +248,13 @@
      */
     @RestrictTo(LIBRARY_GROUP_PREFIX)
     public static class DummyFragment extends Fragment {
+        @NonNull
         @Override
-        public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                Bundle savedInstanceState) {
+        public View onCreateView(
+                @NonNull LayoutInflater inflater,
+                @Nullable ViewGroup container,
+                @Nullable Bundle savedInstanceState
+        ) {
             final View v = new View(inflater.getContext());
             v.setVisibility(View.GONE);
             return v;
@@ -277,6 +282,7 @@
      * a basic GuidanceStylist.
      * @return The GuidanceStylist used in this fragment.
      */
+    @NonNull
     public GuidanceStylist onCreateGuidanceStylist() {
         return new GuidanceStylist();
     }
@@ -286,6 +292,7 @@
      * returns a basic GuidedActionsStylist.
      * @return The GuidedActionsStylist used in this fragment.
      */
+    @NonNull
     public GuidedActionsStylist onCreateActionsStylist() {
         return new GuidedActionsStylist();
     }
@@ -295,6 +302,7 @@
      * The default implementation returns a basic GuidedActionsStylist.
      * @return The GuidedActionsStylist used in this fragment.
      */
+    @NonNull
     public GuidedActionsStylist onCreateButtonActionsStylist() {
         GuidedActionsStylist stylist = new GuidedActionsStylist();
         stylist.setAsButtonActions();
@@ -319,7 +327,7 @@
      * @param savedInstanceState The saved instance state from onCreateView.
      * @return The Guidance object representing the information used to guide the user.
      */
-    public @NonNull Guidance onCreateGuidance(Bundle savedInstanceState) {
+    public @NonNull Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
         return new Guidance("", "", "", null);
     }
 
@@ -329,7 +337,10 @@
      * @param actions A non-null, empty list ready to be populated.
      * @param savedInstanceState The saved instance state from onCreate.
      */
-    public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+    public void onCreateActions(
+            @NonNull List<GuidedAction> actions,
+            @Nullable Bundle savedInstanceState
+    ) {
     }
 
     /**
@@ -338,8 +349,10 @@
      * @param actions A non-null, empty list ready to be populated.
      * @param savedInstanceState The saved instance state from onCreate.
      */
-    public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
-            Bundle savedInstanceState) {
+    public void onCreateButtonActions(
+            @NonNull List<GuidedAction> actions,
+            @Nullable Bundle savedInstanceState
+    ) {
     }
 
     /**
@@ -347,7 +360,7 @@
      * order to act on the user's decisions.
      * @param action The chosen action.
      */
-    public void onGuidedActionClicked(GuidedAction action) {
+    public void onGuidedActionClicked(@NonNull GuidedAction action) {
     }
 
     /**
@@ -357,7 +370,7 @@
      * @param action The chosen action.
      * @return true to collapse the sub actions list, false to keep it expanded.
      */
-    public boolean onSubGuidedActionClicked(GuidedAction action) {
+    public boolean onSubGuidedActionClicked(@NonNull GuidedAction action) {
         return true;
     }
 
@@ -381,7 +394,7 @@
      * @param action GuidedAction to expand.
      * @see #expandAction(GuidedAction, boolean)
      */
-    public void expandSubActions(GuidedAction action) {
+    public void expandSubActions(@NonNull GuidedAction action) {
         if (!action.hasSubActions()) {
             return;
         }
@@ -396,7 +409,7 @@
      * @param action GuidedAction to expand.
      * @param withTransition True to run transition animation, false otherwise.
      */
-    public void expandAction(GuidedAction action, boolean withTransition) {
+    public void expandAction(@NonNull GuidedAction action, boolean withTransition) {
         mActionsStylist.expandAction(action, withTransition);
     }
 
@@ -443,7 +456,7 @@
      * {@link #onGuidedActionEdited(GuidedAction)}.
      * @param action The action which has been canceled editing.
      */
-    public void onGuidedActionEditCanceled(GuidedAction action) {
+    public void onGuidedActionEditCanceled(@NonNull GuidedAction action) {
         onGuidedActionEdited(action);
     }
 
@@ -456,7 +469,7 @@
      * @return ID of the action will be focused or {@link GuidedAction#ACTION_ID_NEXT},
      * {@link GuidedAction#ACTION_ID_CURRENT}.
      */
-    public long onGuidedActionEditedAndProceed(GuidedAction action) {
+    public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
         onGuidedActionEdited(action);
         return GuidedAction.ACTION_ID_NEXT;
     }
@@ -467,9 +480,14 @@
      * transitions.  A backstack entry is added, so the fragment will be dismissed when BACK key
      * is pressed.
      * <ul>
-     * <li>If current fragment on stack is GuidedStepFragment: assign {@link #UI_STYLE_REPLACE}</li>
-     * <li>If current fragment on stack is not GuidedStepFragment: assign
-     * {@link #UI_STYLE_ENTRANCE}</li>
+     * <li>
+     *     If current fragment on stack is GuidedStepFragment: assign
+     *     {@link #UI_STYLE_REPLACE}
+     * </li>
+     * <li>
+     *     If current fragment on stack is not GuidedStepFragment: assign
+     *     {@link #UI_STYLE_ENTRANCE}
+     * </li>
      * </ul>
      * <p>
      * Note: currently fragments added using this method must be created programmatically rather
@@ -478,7 +496,9 @@
      * @param fragment The GuidedStepFragment to be inserted into the fragment stack.
      * @return The ID returned by the call FragmentTransaction.commit.
      */
-    public static int add(FragmentManager fragmentManager, GuidedStepFragment fragment) {
+    public static int add(
+            @NonNull FragmentManager fragmentManager,
+            @NonNull GuidedStepFragment fragment) {
         return add(fragmentManager, fragment, android.R.id.content);
     }
 
@@ -488,11 +508,16 @@
      * transitions.  A backstack entry is added, so the fragment will be dismissed when BACK key
      * is pressed.
      * <ul>
-     * <li>If current fragment on stack is GuidedStepFragment: assign {@link #UI_STYLE_REPLACE} and
-     * {@link #onAddSharedElementTransition(FragmentTransaction, GuidedStepFragment)} will be called
-     * to perform shared element transition between GuidedStepFragments.</li>
-     * <li>If current fragment on stack is not GuidedStepFragment: assign
-     * {@link #UI_STYLE_ENTRANCE}</li>
+     * <li>
+     *     If current fragment on stack is GuidedStepFragment: assign
+     *     {@link #UI_STYLE_REPLACE} and
+     *     {@link #onAddSharedElementTransition(FragmentTransaction, GuidedStepFragment)}
+     *     will be called to perform shared element transition between GuidedStepFragments.
+     * </li>
+     * <li>
+     *     If current fragment on stack is not GuidedStepFragment: assign
+     *     {@link #UI_STYLE_ENTRANCE}
+     * </li>
      * </ul>
      * <p>
      * Note: currently fragments added using this method must be created programmatically rather
@@ -502,7 +527,11 @@
      * @param id The id of container to add GuidedStepFragment, can be android.R.id.content.
      * @return The ID returned by the call FragmentTransaction.commit.
      */
-    public static int add(FragmentManager fragmentManager, GuidedStepFragment fragment, int id) {
+    public static int add(
+            @NonNull FragmentManager fragmentManager,
+            @NonNull GuidedStepFragment fragment,
+            int id
+    ) {
         GuidedStepFragment current = getCurrentGuidedStepFragment(fragmentManager);
         boolean inGuidedStep = current != null;
         if (IS_FRAMEWORK_FRAGMENT && Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT < 23
@@ -535,8 +564,10 @@
      * @param ft The FragmentTransaction to add shared element.
      * @param disappearing The disappearing fragment.
      */
-    protected void onAddSharedElementTransition(FragmentTransaction ft, GuidedStepFragment
-            disappearing) {
+    protected void onAddSharedElementTransition(
+            @NonNull FragmentTransaction ft,
+            @NonNull GuidedStepFragment disappearing
+    ) {
         View fragmentView = disappearing.getView();
         addNonNullSharedElementTransition(ft, fragmentView.findViewById(
                 R.id.action_fragment_root), "action_fragment_root");
@@ -642,7 +673,11 @@
      * @return The ID returned by the call FragmentTransaction.commit, or -1 there is already
      *         GuidedStepFragment.
      */
-    public static int addAsRoot(Activity activity, GuidedStepFragment fragment, int id) {
+    public static int addAsRoot(
+            @NonNull Activity activity,
+            @NonNull GuidedStepFragment fragment,
+            int id
+    ) {
         // Workaround b/23764120: call getDecorView() to force requestFeature of ActivityTransition.
         activity.getWindow().getDecorView();
         FragmentManager fragmentManager = activity.getFragmentManager();
@@ -660,7 +695,10 @@
      * Returns the current GuidedStepFragment on the fragment transaction stack.
      * @return The current GuidedStepFragment, if any, on the fragment transaction stack.
      */
-    public static GuidedStepFragment getCurrentGuidedStepFragment(FragmentManager fm) {
+    @Nullable
+    public static GuidedStepFragment getCurrentGuidedStepFragment(
+            @NonNull FragmentManager fm
+    ) {
         Fragment f = fm.findFragmentByTag(TAG_LEAN_BACK_ACTIONS_FRAGMENT);
         if (f instanceof GuidedStepFragment) {
             return (GuidedStepFragment) f;
@@ -672,6 +710,7 @@
      * Returns the GuidanceStylist that displays guidance information for the user.
      * @return The GuidanceStylist for this fragment.
      */
+    @NonNull
     public GuidanceStylist getGuidanceStylist() {
         return mGuidanceStylist;
     }
@@ -680,6 +719,7 @@
      * Returns the GuidedActionsStylist that displays the actions the user may take.
      * @return The GuidedActionsStylist for this fragment.
      */
+    @NonNull
     public GuidedActionsStylist getGuidedActionsStylist() {
         return mActionsStylist;
     }
@@ -688,6 +728,7 @@
      * Returns the list of button GuidedActions that the user may take in this fragment.
      * @return The list of button GuidedActions for this fragment.
      */
+    @NonNull
     public List<GuidedAction> getButtonActions() {
         return mButtonActions;
     }
@@ -697,6 +738,7 @@
      * @param id  Id of the button action to search.
      * @return  GuidedAction object or null if not found.
      */
+    @Nullable
     public GuidedAction findButtonActionById(long id) {
         int index = findButtonActionPositionById(id);
         return index >= 0 ? mButtonActions.get(index) : null;
@@ -722,6 +764,7 @@
      * Returns the GuidedActionsStylist that displays the button actions the user may take.
      * @return The GuidedActionsStylist for this fragment.
      */
+    @NonNull
     public GuidedActionsStylist getGuidedButtonActionsStylist() {
         return mButtonActionsStylist;
     }
@@ -730,7 +773,7 @@
      * Sets the list of button GuidedActions that the user may take in this fragment.
      * @param actions The list of button GuidedActions for this fragment.
      */
-    public void setButtonActions(List<GuidedAction> actions) {
+    public void setButtonActions(@NonNull List<GuidedAction> actions) {
         mButtonActions = actions;
         if (mButtonAdapter != null) {
             mButtonAdapter.setActions(mButtonActions);
@@ -754,6 +797,7 @@
      * @return The View corresponding to the button action at the indicated position, or null if
      * that action is not currently onscreen.
      */
+    @Nullable
     public View getButtonActionItemView(int position) {
         final RecyclerView.ViewHolder holder = mButtonActionsStylist.getActionsGridView()
                     .findViewHolderForPosition(position);
@@ -780,6 +824,7 @@
      * Returns the list of GuidedActions that the user may take in this fragment.
      * @return The list of GuidedActions for this fragment.
      */
+    @NonNull
     public List<GuidedAction> getActions() {
         return mActions;
     }
@@ -789,6 +834,7 @@
      * @param id  Id of the action to search.
      * @return  GuidedAction object or null if not found.
      */
+    @Nullable
     public GuidedAction findActionById(long id) {
         int index = findActionPositionById(id);
         return index >= 0 ? mActions.get(index) : null;
@@ -816,7 +862,7 @@
      *
      * @param actions The list of GuidedActions for this fragment.
      */
-    public void setActions(List<GuidedAction> actions) {
+    public void setActions(@NonNull List<GuidedAction> actions) {
         mActions = actions;
         if (mAdapter != null) {
             mAdapter.setActions(mActions);
@@ -831,7 +877,7 @@
      *
      * @param diffCallback DiffCallback used in {@link #setActions(List)}.
      */
-    public void setActionsDiffCallback(DiffCallback<GuidedAction> diffCallback) {
+    public void setActionsDiffCallback(@Nullable DiffCallback<GuidedAction> diffCallback) {
         mAdapter.setDiffCallback(diffCallback);
     }
 
@@ -852,6 +898,7 @@
      * @return The View corresponding to the action at the indicated position, or null if that
      * action is not currently onscreen.
      */
+    @Nullable
     public View getActionItemView(int position) {
         final RecyclerView.ViewHolder holder = mActionsStylist.getActionsGridView()
                     .findViewHolderForPosition(position);
@@ -961,8 +1008,12 @@
      * @param savedInstanceState
      * @return Created background view or null if no background.
      */
-    public View onCreateBackgroundView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateBackgroundView(
+            @NonNull LayoutInflater inflater,
+            @Nullable ViewGroup container,
+            @Nullable Bundle savedInstanceState
+    ) {
         return inflater.inflate(R.layout.lb_guidedstep_background, container, false);
     }
 
@@ -1015,7 +1066,7 @@
      * {@inheritDoc}
      */
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         if (DEBUG) Log.v(TAG, "onCreate");
 
@@ -1060,8 +1111,8 @@
      * {@inheritDoc}
      */
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         if (DEBUG) Log.v(TAG, "onCreateView");
 
         resolveTheme();
@@ -1298,8 +1349,10 @@
      * @param  guidedStepFragmentClass  Name of the Class of GuidedStepFragment to pop to.
      * @param flags Either 0 or {@link FragmentManager#POP_BACK_STACK_INCLUSIVE}.
      */
-    public void popBackStackToGuidedStepFragment(Class<?> guidedStepFragmentClass,
-            int flags) {
+    public void popBackStackToGuidedStepFragment(
+            @NonNull Class<?> guidedStepFragmentClass,
+            int flags
+    ) {
         if (!GuidedStepFragment.class.isAssignableFrom(guidedStepFragmentClass)) {
             return;
         }
@@ -1360,7 +1413,7 @@
      * used to programmatically skip the extra click required to go into edit mode. This method
      * can be invoked in {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
      */
-    public void openInEditMode(GuidedAction action) {
+    public void openInEditMode(@Nullable GuidedAction action) {
         mActionsStylist.openInEditMode(action);
     }
 
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
index 3eecfb2..17ef924 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
@@ -1105,11 +1105,9 @@
     /**
      * {@inheritDoc}
      */
-    @Nullable
     @Override
-    public View onCreateView(
-            @NonNull LayoutInflater inflater,
-            @Nullable ViewGroup container,
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
             @Nullable Bundle savedInstanceState) {
         if (DEBUG) Log.v(TAG, "onCreateView");
 
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingFragment.java
index ff14ba3..a0ec019 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingFragment.java
@@ -308,10 +308,9 @@
         }
     }
 
-    @Nullable
     @Override
-    public View onCreateView(LayoutInflater inflater, final ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         resolveTheme();
         LayoutInflater localInflater = getThemeInflater(inflater);
         final ViewGroup view = (ViewGroup) localInflater.inflate(R.layout.lb_onboarding_fragment,
@@ -515,6 +514,7 @@
      * Returns the start button text if it's set through
      * {@link #setStartButtonText(CharSequence)}}. If no string was set, null is returned.
      */
+    @Nullable
     public final CharSequence getStartButtonText() {
         return mStartButtonText;
     }
@@ -525,7 +525,7 @@
      *
      * @param text the start button text
      */
-    public void setStartButtonText(CharSequence text) {
+    public void setStartButtonText(@Nullable CharSequence text) {
         mStartButtonText = text;
         mStartButtonTextSet = true;
         if (mStartButton != null) {
@@ -778,6 +778,7 @@
      * Provides the entry animation for description view. This allows users to override the
      * default fade and slide animation. Returning null will disable the animation.
      */
+    @NonNull
     protected Animator onCreateDescriptionAnimator() {
         return AnimatorInflater.loadAnimator(FragmentUtil.getContext(OnboardingFragment.this),
                 R.animator.lb_onboarding_description_enter);
@@ -787,6 +788,7 @@
      * Provides the entry animation for title view. This allows users to override the
      * default fade and slide animation. Returning null will disable the animation.
      */
+    @NonNull
     protected Animator onCreateTitleAnimator() {
         return AnimatorInflater.loadAnimator(FragmentUtil.getContext(OnboardingFragment.this),
                 R.animator.lb_onboarding_title_enter);
@@ -806,7 +808,7 @@
      *
      * @return The page count.
      */
-    abstract protected int getPageCount();
+    protected abstract int getPageCount();
 
     /**
      * Returns the title of the given page.
@@ -815,7 +817,8 @@
      *
      * @return The title of the page.
      */
-    abstract protected CharSequence getPageTitle(int pageIndex);
+    @Nullable
+    protected abstract CharSequence getPageTitle(int pageIndex);
 
     /**
      * Returns the description of the given page.
@@ -824,7 +827,8 @@
      *
      * @return The description of the page.
      */
-    abstract protected CharSequence getPageDescription(int pageIndex);
+    @Nullable
+    protected abstract CharSequence getPageDescription(int pageIndex);
 
     /**
      * Returns the index of the current page.
@@ -847,7 +851,10 @@
      * @return The background view for the onboarding screen, or {@code null}.
      */
     @Nullable
-    abstract protected View onCreateBackgroundView(LayoutInflater inflater, ViewGroup container);
+    protected abstract View onCreateBackgroundView(
+            @NonNull LayoutInflater inflater,
+            @NonNull ViewGroup container
+    );
 
     /**
      * Called to have the inherited class create content view. This is optional and the fragment
@@ -863,7 +870,10 @@
      * @return The content view for the onboarding screen, or {@code null}.
      */
     @Nullable
-    abstract protected View onCreateContentView(LayoutInflater inflater, ViewGroup container);
+    protected abstract View onCreateContentView(
+            @NonNull LayoutInflater inflater,
+            @NonNull ViewGroup container
+    );
 
     /**
      * Called to have the inherited class create foreground view. This is optional and the fragment
@@ -879,7 +889,10 @@
      * @return The foreground view for the onboarding screen, or {@code null}.
      */
     @Nullable
-    abstract protected View onCreateForegroundView(LayoutInflater inflater, ViewGroup container);
+    protected abstract View onCreateForegroundView(
+            @NonNull LayoutInflater inflater,
+            @NonNull ViewGroup container
+    );
 
     /**
      * Called when the onboarding flow finishes.
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingSupportFragment.java
index 00ceff8..92be32e 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/OnboardingSupportFragment.java
@@ -303,9 +303,9 @@
         }
     }
 
-    @Nullable
     @Override
-    public View onCreateView(@NonNull LayoutInflater inflater, final @Nullable ViewGroup container,
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
             @Nullable Bundle savedInstanceState) {
         resolveTheme();
         LayoutInflater localInflater = getThemeInflater(inflater);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java
index efa6de9..952bd94 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java
@@ -915,8 +915,8 @@
             };
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         mRootView = inflater.inflate(R.layout.lb_playback_fragment, container, false);
         mBackgroundView = mRootView.findViewById(R.id.playback_fragment_background);
         mRowsFragment = (RowsFragment) getChildFragmentManager().findFragmentById(
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java
index b9423b3..11aa41a 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java
@@ -910,8 +910,9 @@
             };
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+                             @Nullable Bundle savedInstanceState) {
         mRootView = inflater.inflate(R.layout.lb_playback_fragment, container, false);
         mBackgroundView = mRootView.findViewById(R.id.playback_fragment_background);
         mRowsSupportFragment = (RowsSupportFragment) getChildFragmentManager().findFragmentById(
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/SearchFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/SearchFragment.java
index dc49c69..181c6e7 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/SearchFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/SearchFragment.java
@@ -31,6 +31,8 @@
 import android.view.ViewGroup;
 import android.view.inputmethod.CompletionInfo;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import android.app.Fragment;
 import androidx.leanback.R;
 import androidx.leanback.widget.BrowseFrameLayout;
@@ -294,8 +296,8 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         View root = inflater.inflate(R.layout.lb_search_fragment, container, false);
 
         BrowseFrameLayout searchFrame = root.findViewById(R.id.lb_search_frame);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/SearchSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/SearchSupportFragment.java
index 3c3a515..17ffd88 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/SearchSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/SearchSupportFragment.java
@@ -28,6 +28,8 @@
 import android.view.ViewGroup;
 import android.view.inputmethod.CompletionInfo;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 import androidx.leanback.R;
 import androidx.leanback.widget.BrowseFrameLayout;
@@ -289,8 +291,9 @@
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+            @Nullable Bundle savedInstanceState) {
         View root = inflater.inflate(R.layout.lb_search_fragment, container, false);
 
         BrowseFrameLayout searchFrame = root.findViewById(R.id.lb_search_frame);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridFragment.java
index 73047073..85a8974 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridFragment.java
@@ -22,6 +22,8 @@
 import android.view.View;
 import android.view.ViewGroup;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.leanback.R;
 import androidx.leanback.transition.TransitionHelper;
 import androidx.leanback.util.StateMachine.State;
@@ -81,7 +83,7 @@
     /**
      * Sets the grid presenter.
      */
-    public void setGridPresenter(VerticalGridPresenter gridPresenter) {
+    public void setGridPresenter(@NonNull VerticalGridPresenter gridPresenter) {
         if (gridPresenter == null) {
             throw new IllegalArgumentException("Grid presenter may not be null");
         }
@@ -95,6 +97,7 @@
     /**
      * Returns the grid presenter.
      */
+    @Nullable
     public VerticalGridPresenter getGridPresenter() {
         return mGridPresenter;
     }
@@ -102,7 +105,7 @@
     /**
      * Sets the object adapter for the fragment.
      */
-    public void setAdapter(ObjectAdapter adapter) {
+    public void setAdapter(@Nullable ObjectAdapter adapter) {
         mAdapter = adapter;
         updateAdapter();
     }
@@ -110,6 +113,7 @@
     /**
      * Returns the object adapter.
      */
+    @Nullable
     public ObjectAdapter getAdapter() {
         return mAdapter;
     }
@@ -132,7 +136,12 @@
     final private OnChildLaidOutListener mChildLaidOutListener =
             new OnChildLaidOutListener() {
         @Override
-        public void onChildLaidOut(ViewGroup parent, View view, int position, long id) {
+        public void onChildLaidOut(
+                @NonNull ViewGroup parent,
+                @NonNull View view,
+                int position,
+                long id
+        ) {
             if (position == 0) {
                 showOrHideTitle();
             }
@@ -142,7 +151,7 @@
     /**
      * Sets an item selection listener.
      */
-    public void setOnItemViewSelectedListener(OnItemViewSelectedListener listener) {
+    public void setOnItemViewSelectedListener(@Nullable OnItemViewSelectedListener listener) {
         mOnItemViewSelectedListener = listener;
     }
 
@@ -168,7 +177,7 @@
     /**
      * Sets an item clicked listener.
      */
-    public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
+    public void setOnItemViewClickedListener(@Nullable OnItemViewClickedListener listener) {
         mOnItemViewClickedListener = listener;
         if (mGridPresenter != null) {
             mGridPresenter.setOnItemViewClickedListener(mOnItemViewClickedListener);
@@ -178,13 +187,14 @@
     /**
      * Returns the item clicked listener.
      */
+    @Nullable
     public OnItemViewClickedListener getOnItemViewClickedListener() {
         return mOnItemViewClickedListener;
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         ViewGroup root = (ViewGroup) inflater.inflate(R.layout.lb_vertical_grid_fragment,
                 container, false);
         ViewGroup gridFrame = (ViewGroup) root.findViewById(R.id.grid_frame);
@@ -247,13 +257,14 @@
     }
 
     @Override
+    @NonNull
     protected Object createEntranceTransition() {
         return TransitionHelper.loadTransition(FragmentUtil.getContext(VerticalGridFragment.this),
                 R.transition.lb_vertical_grid_entrance_transition);
     }
 
     @Override
-    protected void runEntranceTransition(Object entranceTransition) {
+    protected void runEntranceTransition(@Nullable Object entranceTransition) {
         TransitionHelper.runTransition(mSceneAfterEntranceTransition, entranceTransition);
     }
 
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridSupportFragment.java
index 764f988..4189876 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/VerticalGridSupportFragment.java
@@ -188,7 +188,7 @@
     }
 
     @Override
-    @NonNull
+    @Nullable
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
             @Nullable Bundle savedInstanceState) {
         ViewGroup root = (ViewGroup) inflater.inflate(R.layout.lb_vertical_grid_fragment,
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/VideoFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/VideoFragment.java
index 2623fd6..125240d5 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/VideoFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/VideoFragment.java
@@ -23,6 +23,8 @@
 import android.view.View;
 import android.view.ViewGroup;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.leanback.R;
 
 /**
@@ -43,8 +45,8 @@
     int mState = SURFACE_NOT_CREATED;
 
     @Override
-    public View onCreateView(
-            LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
         ViewGroup root = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState);
         mVideoSurface = (SurfaceView) LayoutInflater.from(FragmentUtil.getContext(VideoFragment.this)).inflate(
                 R.layout.lb_video_surface, root, false);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/VideoSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/VideoSupportFragment.java
index ca286a4..2a79f91 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/VideoSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/VideoSupportFragment.java
@@ -20,6 +20,8 @@
 import android.view.View;
 import android.view.ViewGroup;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.leanback.R;
 
 /**
@@ -38,8 +40,9 @@
     int mState = SURFACE_NOT_CREATED;
 
     @Override
-    public View onCreateView(
-            LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+    @Nullable
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+            @Nullable Bundle savedInstanceState) {
         ViewGroup root = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState);
         mVideoSurface = (SurfaceView) LayoutInflater.from(getContext()).inflate(
                 R.layout.lb_video_surface, root, false);
diff --git a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAppCompatEditText.java b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAppCompatEditText.java
new file mode 100644
index 0000000..0fc46c2
--- /dev/null
+++ b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAppCompatEditText.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.leanback.widget;
+
+import android.content.Context;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.ActionMode;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.autofill.AutofillValue;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.appcompat.widget.AppCompatEditText;
+import androidx.core.widget.TextViewCompat;
+
+/**
+ * A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment.
+ */
+public class GuidedActionAppCompatEditText extends AppCompatEditText implements ImeKeyMonitor,
+        GuidedActionAutofillSupport {
+
+    private ImeKeyListener mKeyListener;
+    private OnAutofillListener mAutofillListener;
+    private final Drawable mSavedBackground;
+    private final Drawable mNoPaddingDrawable;
+
+    public GuidedActionAppCompatEditText(@NonNull Context ctx) {
+        this(ctx, null);
+    }
+
+    public GuidedActionAppCompatEditText(@NonNull Context ctx, @Nullable AttributeSet attrs) {
+        this(ctx, attrs, android.R.attr.editTextStyle);
+    }
+
+    public GuidedActionAppCompatEditText(@NonNull Context ctx, @Nullable AttributeSet attrs,
+            int defStyleAttr) {
+        super(ctx, attrs, defStyleAttr);
+        mSavedBackground = getBackground();
+        mNoPaddingDrawable = new GuidedActionEditText.NoPaddingDrawable();
+        setBackground(mNoPaddingDrawable);
+    }
+
+    @Override
+    public void setImeKeyListener(@Nullable ImeKeyListener listener) {
+        mKeyListener = listener;
+    }
+
+    @Override
+    public boolean onKeyPreIme(int keyCode, @Nullable KeyEvent event) {
+        boolean result = false;
+        if (mKeyListener != null) {
+            result = mKeyListener.onKeyPreIme(this, keyCode, event);
+        }
+        if (!result) {
+            result = super.onKeyPreIme(keyCode, event);
+        }
+        return result;
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(@Nullable AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(isFocused()
+                ? AppCompatEditText.class.getName() : TextView.class.getName());
+    }
+
+    @Override
+    protected void onFocusChanged(boolean focused, int direction,
+            @Nullable Rect previouslyFocusedRect) {
+        super.onFocusChanged(focused, direction, previouslyFocusedRect);
+        if (focused) {
+            setBackground(mSavedBackground);
+        } else {
+            setBackground(mNoPaddingDrawable);
+        }
+        // Make the TextView focusable during editing, avoid the TextView gets accessibility focus
+        // before editing started. See also GuidedActionAdapterGroup where setFocusable(true).
+        if (!focused) {
+            setFocusable(false);
+        }
+    }
+
+    @RequiresApi(26)
+    @Override
+    public int getAutofillType() {
+        // Make it always autofillable as Guided fragment switches InputType when user clicks
+        // on the field.
+        return AUTOFILL_TYPE_TEXT;
+    }
+
+    @Override
+    public void setOnAutofillListener(@Nullable OnAutofillListener autofillListener) {
+        mAutofillListener = autofillListener;
+    }
+
+    @Override
+    public void autofill(@Nullable AutofillValue values) {
+        super.autofill(values);
+        if (mAutofillListener != null) {
+            mAutofillListener.onAutofill(this);
+        }
+    }
+
+    /**
+     * See
+     * {@link TextViewCompat#setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)}
+     */
+    @Override
+    public void setCustomSelectionActionModeCallback(
+            @Nullable ActionMode.Callback actionModeCallback) {
+        super.setCustomSelectionActionModeCallback(TextViewCompat
+                .wrapCustomSelectionActionModeCallback(this, actionModeCallback));
+    }
+
+    @Override
+    public boolean onTouchEvent(@Nullable MotionEvent event) {
+        // b/143562736 when in touch screen mode, if the EditText is not focusable
+        // and not text selectable, it does not need TouchEvent; let parent handle TouchEvent,
+        // e.g. receives onClick event.
+        if (isInTouchMode() && !isFocusableInTouchMode() && !isTextSelectable()) {
+            return false;
+        }
+        return super.onTouchEvent(event);
+    }
+}
diff --git a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java
index 4020298..49606dc 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java
@@ -26,17 +26,18 @@
 import android.view.MotionEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.autofill.AutofillValue;
+import android.widget.EditText;
 import android.widget.TextView;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.RequiresApi;
-import androidx.appcompat.widget.AppCompatEditText;
 import androidx.core.widget.TextViewCompat;
 
 /**
  * A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment.
  */
-public class GuidedActionEditText extends AppCompatEditText implements ImeKeyMonitor,
+@SuppressLint("AppCompatCustomView")
+public class GuidedActionEditText extends EditText implements ImeKeyMonitor,
         GuidedActionAutofillSupport {
 
     /**
@@ -108,8 +109,7 @@
     @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
-        info.setClassName(isFocused() ?
-                AppCompatEditText.class.getName() : TextView.class.getName());
+        info.setClassName(isFocused() ? EditText.class.getName() : TextView.class.getName());
     }
 
     @Override
@@ -121,7 +121,7 @@
             setBackground(mNoPaddingDrawable);
         }
         // Make the TextView focusable during editing, avoid the TextView gets accessibility focus
-        // before editing started. see also GuidedActionAdapterGroup where setFocusable(true).
+        // before editing started. See also GuidedActionAdapterGroup where setFocusable(true).
         if (!focused) {
             setFocusable(false);
         }
@@ -130,7 +130,7 @@
     @RequiresApi(26)
     @Override
     public int getAutofillType() {
-        // make it always autofillable as Guided fragment switches InputType when user clicks
+        // Make it always autofillable as Guided fragment switches InputType when user clicks
         // on the field.
         return AUTOFILL_TYPE_TEXT;
     }
diff --git a/leanback/leanback/src/main/java/androidx/leanback/widget/LeanbackAppCompatViewInflater.java b/leanback/leanback/src/main/java/androidx/leanback/widget/LeanbackAppCompatViewInflater.java
new file mode 100644
index 0000000..1993c8d
--- /dev/null
+++ b/leanback/leanback/src/main/java/androidx/leanback/widget/LeanbackAppCompatViewInflater.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.leanback.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatViewInflater;
+
+/** Inflater that converts leanback non-AppCpmpat views in layout to AppCompat versions. */
+public class LeanbackAppCompatViewInflater extends AppCompatViewInflater {
+
+    @Override
+    @NonNull
+    protected View createView(@Nullable Context context, @Nullable String name,
+            @Nullable AttributeSet attrs) {
+        switch (name) {
+            case "androidx.leanback.widget.GuidedActionEditText":
+                return new GuidedActionAppCompatEditText(context, attrs);
+        }
+        return null;
+    }
+
+}
diff --git a/leanback/leanback/src/main/res/values-v18/themes_appcompat.xml b/leanback/leanback/src/main/res/values-v18/themes_appcompat.xml
index 873a34c..4a6496c 100644
--- a/leanback/leanback/src/main/res/values-v18/themes_appcompat.xml
+++ b/leanback/leanback/src/main/res/values-v18/themes_appcompat.xml
@@ -18,6 +18,7 @@
 <resources>
     <!-- Alternative leanback theme which is to be used when extending AppCompatActivity -->
     <style name="Theme.AppCompat.LeanbackBase" parent="Theme.AppCompat.NoActionBar">
+        <item name="viewInflaterClass">androidx.leanback.widget.LeanbackAppCompatViewInflater</item>
         <item name="playbackProgressPrimaryColor">@color/lb_playback_progress_color_no_theme</item>
         <item name="playbackControlsIconHighlightColor">@color/lb_playback_icon_highlight_no_theme</item>
         <item name="defaultBrandColor">@color/lb_default_brand_color</item>
diff --git a/leanback/leanback/src/main/res/values-v19/themes_appcompat.xml b/leanback/leanback/src/main/res/values-v19/themes_appcompat.xml
index 15e30cf..fa41224 100644
--- a/leanback/leanback/src/main/res/values-v19/themes_appcompat.xml
+++ b/leanback/leanback/src/main/res/values-v19/themes_appcompat.xml
@@ -18,6 +18,7 @@
 <resources>
     <!-- Alternative leanback theme which is to be used when extending AppCompatActivity -->
     <style name="Theme.AppCompat.LeanbackBase" parent="Theme.AppCompat.NoActionBar">
+        <item name="viewInflaterClass">androidx.leanback.widget.LeanbackAppCompatViewInflater</item>
         <item name="playbackProgressPrimaryColor">@color/lb_playback_progress_color_no_theme</item>
         <item name="playbackControlsIconHighlightColor">@color/lb_playback_icon_highlight_no_theme</item>
         <item name="defaultBrandColor">@color/lb_default_brand_color</item>
diff --git a/leanback/leanback/src/main/res/values-v21/themes_appcompat.xml b/leanback/leanback/src/main/res/values-v21/themes_appcompat.xml
index 31d3248..1df10bb 100644
--- a/leanback/leanback/src/main/res/values-v21/themes_appcompat.xml
+++ b/leanback/leanback/src/main/res/values-v21/themes_appcompat.xml
@@ -18,6 +18,7 @@
 <resources>
     <!-- Alternative leanback theme which is to be used when extending AppCompatActivity -->
     <style name="Theme.AppCompat.LeanbackBase" parent="Theme.AppCompat.NoActionBar">
+        <item name="viewInflaterClass">androidx.leanback.widget.LeanbackAppCompatViewInflater</item>
         <item name="playbackProgressPrimaryColor">?android:attr/colorAccent</item>
         <item name="playbackControlsIconHighlightColor">?android:attr/colorAccent</item>
         <item name="defaultBrandColor">?android:attr/colorPrimary</item>
diff --git a/leanback/leanback/src/main/res/values/themes_appcompat.xml b/leanback/leanback/src/main/res/values/themes_appcompat.xml
index f427184..9cb16a2 100644
--- a/leanback/leanback/src/main/res/values/themes_appcompat.xml
+++ b/leanback/leanback/src/main/res/values/themes_appcompat.xml
@@ -23,6 +23,7 @@
         inflater and some AppCompat widget might not work as expected on TV.
     -->
     <style name="Theme.AppCompat.LeanbackBase" parent="Theme.AppCompat.NoActionBar">
+        <item name="viewInflaterClass">androidx.leanback.widget.LeanbackAppCompatViewInflater</item>
         <item name="playbackProgressPrimaryColor">@color/lb_playback_progress_color_no_theme</item>
         <item name="playbackProgressSecondaryColor">@color/lb_playback_progress_secondary_color_no_theme</item>
         <item name="playbackControlsIconHighlightColor">@color/lb_playback_icon_highlight_no_theme</item>
diff --git a/samples/SupportLeanbackDemos/generatev4.py b/samples/SupportLeanbackDemos/generatev4.py
index 480946b..01fc793 100755
--- a/samples/SupportLeanbackDemos/generatev4.py
+++ b/samples/SupportLeanbackDemos/generatev4.py
@@ -38,6 +38,19 @@
 file.close()
 outfile.close()
 
+file = open('src/main/java/com/example/android/leanback/GuidedStepActivity.java', 'r')
+outfile = open('src/main/java/com/example/android/leanback/GuidedStepAppCompatActivity.java', 'w')
+write_java_head(outfile, "GuidedStepActivity")
+for line in file:
+    line = line.replace('android.app.Fragment', 'androidx.fragment.app.Fragment')
+    line = line.replace('android.app.Activity', 'androidx.appcompat.app.AppCompatActivity')
+    line = line.replace('GuidedStepFragment', 'GuidedStepSupportFragment')
+    line = line.replace('GuidedStepActivity', 'GuidedStepAppCompatActivity')
+    line = line.replace('extends Activity', 'extends AppCompatActivity')
+    outfile.write(line)
+file.close()
+outfile.close()
+
 file = open('src/main/java/com/example/android/leanback/GuidedStepHalfScreenActivity.java', 'r')
 outfile = open('src/main/java/com/example/android/leanback/GuidedStepSupportHalfScreenActivity.java', 'w')
 write_java_head(outfile, "GuidedStepHalfScreenActivity")
diff --git a/samples/SupportLeanbackDemos/src/main/AndroidManifest.xml b/samples/SupportLeanbackDemos/src/main/AndroidManifest.xml
index 64a5bed..995574c 100644
--- a/samples/SupportLeanbackDemos/src/main/AndroidManifest.xml
+++ b/samples/SupportLeanbackDemos/src/main/AndroidManifest.xml
@@ -159,6 +159,11 @@
             android:windowSoftInputMode="adjustResize"
             android:exported="true" />
 
+        <activity android:name="GuidedStepAppCompatActivity"
+            android:theme="@style/Theme.Example.AppCompat.Leanback.GuidedStep"
+            android:windowSoftInputMode="adjustResize"
+            android:exported="true" />
+
         <activity android:name="GuidedStepHalfScreenActivity"
             android:theme="@style/Theme.Example.Leanback.GuidedStep.Half"
             android:windowSoftInputMode="adjustResize"
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseErrorSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseErrorSupportActivity.java
index 2c7f4bc..d3238e0 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseErrorSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseErrorSupportActivity.java
@@ -16,6 +16,8 @@
  */
 package com.example.android.leanback;
 
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.Fragment;
 import android.os.Bundle;
 import android.os.Handler;
 import android.view.Gravity;
@@ -25,9 +27,6 @@
 import android.widget.FrameLayout;
 import android.widget.ProgressBar;
 
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentActivity;
-
 public class BrowseErrorSupportActivity extends FragmentActivity
 {
     /** Called when the activity is first created. */
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportActivity.java
index 1fc483e..19a5841 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportActivity.java
@@ -16,9 +16,8 @@
  */
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 public class BrowseSupportActivity extends FragmentActivity {
     /** Called when the activity is first created. */
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportFragment.java
index 899f79d..9525c8b 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/BrowseSupportFragment.java
@@ -16,6 +16,7 @@
  */
 package com.example.android.leanback;
 
+import androidx.fragment.app.Fragment;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
@@ -26,7 +27,6 @@
 
 import androidx.core.app.ActivityOptionsCompat;
 import androidx.core.content.res.ResourcesCompat;
-import androidx.fragment.app.Fragment;
 import androidx.leanback.app.GuidedStepSupportFragment;
 import androidx.leanback.app.RowsSupportFragment;
 import androidx.leanback.widget.ArrayObjectAdapter;
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsFragment.java
index b2eeb43..44c08aa 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsFragment.java
@@ -21,6 +21,7 @@
 import android.view.View;
 import android.widget.Toast;
 
+import androidx.annotation.NonNull;
 import androidx.core.app.ActivityOptionsCompat;
 import androidx.core.content.res.ResourcesCompat;
 import androidx.leanback.widget.Action;
@@ -173,7 +174,7 @@
         outState.putParcelable(ITEM, mPhotoItem);
     }
 
-    public void setItem(PhotoItem photoItem) {
+    public void setItem(@NonNull PhotoItem photoItem) {
         mPhotoItem = photoItem;
         updateAdapter();
     }
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportActivity.java
index 8930028..286b605 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportActivity.java
@@ -16,9 +16,8 @@
  */
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 @SuppressWarnings("deprecation")
 public class DetailsSupportActivity extends FragmentActivity
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportFragment.java
index 4846eb8..95f5c5a 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/DetailsSupportFragment.java
@@ -172,12 +172,12 @@
 
 
     @Override
-    public void onSaveInstanceState(@NonNull Bundle outState) {
+    public void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
         outState.putParcelable(ITEM, mPhotoItem);
     }
 
-    public void setItem(PhotoItem photoItem) {
+    public void setItem(@NonNull PhotoItem photoItem) {
         mPhotoItem = photoItem;
         updateAdapter();
     }
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepActivity.java
index 77a90b5..1109a7d 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepActivity.java
@@ -31,6 +31,8 @@
 import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.core.content.res.ResourcesCompat;
 import androidx.leanback.app.GuidedStepFragment;
 import androidx.leanback.widget.GuidanceStylist;
@@ -70,7 +72,7 @@
     private static final String TAG = GuidedStepActivity.class.getSimpleName();
 
     @Override
-    protected void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
         Log.v(TAG, "onCreate");
         super.onCreate(savedInstanceState);
         setContentView(R.layout.guided_step_activity);
@@ -81,19 +83,19 @@
     }
 
     @Override
-    public void onConfigurationChanged(Configuration newConfig) {
+    public void onConfigurationChanged(@Nullable Configuration newConfig) {
         Log.v(TAG, "onConfigurationChanged");
         super.onConfigurationChanged(newConfig);
     }
 
     @Override
-    protected void onSaveInstanceState(Bundle outState) {
+    protected void onSaveInstanceState(@Nullable Bundle outState) {
         Log.v(TAG, "onSaveInstanceState");
         super.onSaveInstanceState(outState);
     }
 
     @Override
-    protected void onRestoreInstanceState(Bundle savedInstanceState) {
+    protected void onRestoreInstanceState(@Nullable Bundle savedInstanceState) {
         Log.v(TAG, "onRestoreInstanceState");
         super.onRestoreInstanceState(savedInstanceState);
     }
@@ -194,7 +196,8 @@
         }
 
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_first_title);
             String breadcrumb = getString(R.string.guidedstep_first_breadcrumb);
             String description = getString(R.string.guidedstep_first_description);
@@ -205,7 +208,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context)
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
@@ -222,7 +226,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 GuidedStepFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
@@ -242,7 +246,6 @@
                         .clickAction(GuidedAction.ACTION_ID_CANCEL)
                         .description("Never mind")
                         .build());
-                //setActionsDiffCallback(null);
                 setActions(newActions);
             } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
                 finishGuidedStepFragments();
@@ -267,7 +270,7 @@
         NewPaymentFragmentTarget mNewPaymentTarget;
 
         @Override
-        public void onCreate(Bundle savedInstance) {
+        public void onCreate(@Nullable Bundle savedInstance) {
             super.onCreate(savedInstance);
             Fragment targetFragment = getTargetFragment();
             if (targetFragment instanceof NewPaymentFragmentTarget) {
@@ -277,7 +280,8 @@
         }
 
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_newpayment_title);
             String breadcrumb = getString(R.string.guidedstep_newpayment_breadcrumb);
             String description = getString(R.string.guidedstep_newpayment_description);
@@ -288,7 +292,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             addEditableAction(actions, NEW_PAYMENT, "Input credit card number", "",
                     InputType.TYPE_CLASS_NUMBER,
                     "Input credit card number", "Input credit card number");
@@ -296,7 +301,8 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context).clickAction(GuidedAction.ACTION_ID_OK)
                     .build());
@@ -304,7 +310,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_OK) {
                 CharSequence desc = findActionById(NEW_PAYMENT).getDescription();
                 String cardNumber = desc.subSequence(desc.length() - 4, desc.length()).toString();
@@ -325,7 +331,7 @@
         }
 
         @Override
-        public long onGuidedActionEditedAndProceed(GuidedAction action) {
+        public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
             if (action.getId() == NEW_PAYMENT) {
                 CharSequence editTitle = action.getEditTitle();
                 if (isCardNumberValid(editTitle)) {
@@ -374,7 +380,7 @@
 
         @Override
         public void onNewPaymentAdded(int selection) {
-            // if a new payment is added, we dont need expand the sub actions list.
+            // if a new payment is added, we don't need expand the sub actions list.
             mExpandPaymentListInOnCreateView = false;
             sSelectedCard = selection;
             updatePaymentAction(findActionById(PAYMENT));
@@ -389,6 +395,7 @@
         }
 
         @Override
+        @NonNull
         public GuidedActionsStylist onCreateActionsStylist() {
             return new GuidedActionsStylist() {
                 @Override
@@ -405,7 +412,8 @@
         }
 
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_second_title);
             String breadcrumb = getString(R.string.guidedstep_second_breadcrumb);
             String description = getString(R.string.guidedstep_second_description);
@@ -416,7 +424,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             addEditableAction(getActivity(), actions, FIRST_NAME, "Pat", "Your first name");
             addEditableAction(getActivity(), actions, LAST_NAME, "Smith", "Your last name");
             List<GuidedAction> subActions = new ArrayList<GuidedAction>();
@@ -426,7 +435,8 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
                     .description("Continue")
@@ -435,7 +445,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 FragmentManager fm = getFragmentManager();
                 GuidedStepFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
@@ -457,7 +467,7 @@
         }
 
         @Override
-        public long onGuidedActionEditedAndProceed(GuidedAction action) {
+        public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
             if (action.getId() == PASSWORD) {
                 CharSequence password = action.getEditDescription();
                 if (password.length() > 0) {
@@ -477,7 +487,7 @@
         }
 
         @Override
-        public boolean onSubGuidedActionClicked(GuidedAction action) {
+        public boolean onSubGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.isChecked()) {
                 String payment = action.getTitle().toString();
                 for (int i = 0; i < sCards.size(); i++) {
@@ -500,8 +510,9 @@
         }
 
         @Override
-        public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                Bundle savedInstanceState) {
+        @Nullable
+        public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container,
+                @Nullable Bundle savedInstanceState) {
             View view = super.onCreateView(inflater, container, savedInstanceState);
             if (mExpandPaymentListInOnCreateView) {
                 expandAction(findActionById(PAYMENT), false);
@@ -533,7 +544,8 @@
         private long mSelectedOption = DEFAULT_OPTION;
 
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_third_title);
             String breadcrumb = getString(R.string.guidedstep_third_breadcrumb);
             String description = getString(R.string.guidedstep_third_description);
@@ -544,6 +556,7 @@
         }
 
         @Override
+        @NonNull
         public GuidanceStylist onCreateGuidanceStylist() {
             return new GuidanceStylist() {
                 @Override
@@ -554,7 +567,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             String desc = "The description can be quite long as well.  "
                     + "Just be sure to set multilineDescription to true in the GuidedAction."
                     + "For testing purpose we make this line even longer since "
@@ -581,14 +595,15 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
                     .build());
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 FragmentManager fm = getFragmentManager();
                 FourthStepFragment f = new FourthStepFragment();
@@ -616,7 +631,8 @@
         }
 
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_fourth_title);
             String breadcrumb = getString(R.string.guidedstep_fourth_breadcrumb);
             String description = "You chose: " + OPTION_NAMES[(int) getOption()];
@@ -627,7 +643,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_FINISH)
                     .description("All Done...")
@@ -636,7 +653,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_FINISH) {
                 finishGuidedStepFragments();
             } else if (action.getId() == BACK) {
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepAppCompatActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepAppCompatActivity.java
new file mode 100644
index 0000000..ca76aef
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepAppCompatActivity.java
@@ -0,0 +1,671 @@
+// CHECKSTYLE:OFF Generated code
+/* This file is auto-generated from GuidedStepActivity.java.  DO NOT MODIFY. */
+
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.leanback;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.text.InputType;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.res.ResourcesCompat;
+import androidx.leanback.app.GuidedStepSupportFragment;
+import androidx.leanback.widget.GuidanceStylist;
+import androidx.leanback.widget.GuidanceStylist.Guidance;
+import androidx.leanback.widget.GuidedAction;
+import androidx.leanback.widget.GuidedActionsStylist;
+import androidx.leanback.widget.GuidedDatePickerAction;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
+/**
+ * Activity that showcases different aspects of GuidedStepSupportFragments.
+ */
+public class GuidedStepAppCompatActivity extends AppCompatActivity {
+
+    private static final int BACK = 2;
+
+    private static final int FIRST_NAME = 3;
+    private static final int LAST_NAME = 4;
+    private static final int PASSWORD = 5;
+    private static final int PAYMENT = 6;
+    private static final int NEW_PAYMENT = 7;
+    private static final int PAYMENT_EXPIRE = 8;
+    private static final int REFRESH = 9;
+
+    private static final long RADIO_ID_BASE = 0;
+    private static final long CHECKBOX_ID_BASE = 100;
+
+    private static final long DEFAULT_OPTION = RADIO_ID_BASE;
+
+    private static final String[] OPTION_NAMES = { "Option A", "Option B", "Option C" };
+    private static final String[] OPTION_DESCRIPTIONS = { "Here's one thing you can do",
+            "Here's another thing you can do", "Here's one more thing you can do" };
+
+    private static final String TAG = GuidedStepAppCompatActivity.class.getSimpleName();
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        Log.v(TAG, "onCreate");
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.guided_step_activity);
+        if (savedInstanceState == null) {
+            GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(),
+                    R.id.lb_guidedstep_host);
+        }
+    }
+
+    @Override
+    public void onConfigurationChanged(@Nullable Configuration newConfig) {
+        Log.v(TAG, "onConfigurationChanged");
+        super.onConfigurationChanged(newConfig);
+    }
+
+    @Override
+    protected void onSaveInstanceState(@Nullable Bundle outState) {
+        Log.v(TAG, "onSaveInstanceState");
+        super.onSaveInstanceState(outState);
+    }
+
+    @Override
+    protected void onRestoreInstanceState(@Nullable Bundle savedInstanceState) {
+        Log.v(TAG, "onRestoreInstanceState");
+        super.onRestoreInstanceState(savedInstanceState);
+    }
+
+    private static GuidedAction addAction(List<GuidedAction> actions, long id, String title,
+            String desc) {
+        GuidedAction action;
+        actions.add(action = new GuidedAction.Builder(null)
+                .id(id)
+                .title(title)
+                .description(desc)
+                .build());
+        return action;
+    }
+
+    private static GuidedAction addAction(List<GuidedAction> actions, long id, String title,
+            String desc, List<GuidedAction> subActions) {
+        GuidedAction action;
+        actions.add(action = new GuidedAction.Builder(null)
+                .id(id)
+                .title(title)
+                .description(desc)
+                .subActions(subActions)
+                .build());
+        return action;
+    }
+
+    private static GuidedAction addEditableAction(Context context, List<GuidedAction> actions,
+            long id, String title, String desc) {
+        GuidedAction action;
+        actions.add(action = new GuidedAction.Builder(context)
+                .id(id)
+                .title(title)
+                .description(desc)
+                .editable(true)
+                .icon(androidx.leanback.R.drawable.lb_ic_search_mic)
+                .build());
+        return action;
+    }
+
+    private static GuidedAction addEditableAction(List<GuidedAction> actions, long id, String title,
+            String editTitle, int editInputType, String desc, String editDesc) {
+        GuidedAction action;
+        actions.add(action = new GuidedAction.Builder(null)
+                .id(id)
+                .title(title)
+                .editTitle(editTitle)
+                .editInputType(editInputType)
+                .description(desc)
+                .editDescription(editDesc)
+                .editable(true)
+                .build());
+        return action;
+    }
+
+    private static GuidedDatePickerAction addDatePickerAction(List<GuidedAction> actions, long id,
+            String title) {
+        GuidedDatePickerAction action;
+        actions.add(action = new GuidedDatePickerAction.Builder(null)
+                .id(id)
+                .title(title)
+                .datePickerFormat("MY")
+                .build());
+        return action;
+    }
+
+    private static GuidedAction addEditableDescriptionAction(List<GuidedAction> actions, long id,
+            String title, String desc, String editDescription, int descriptionEditInputType) {
+        GuidedAction action;
+        actions.add(action = new GuidedAction.Builder(null)
+                .id(id)
+                .title(title)
+                .description(desc)
+                .editDescription(editDescription)
+                .descriptionEditInputType(descriptionEditInputType)
+                .descriptionEditable(true)
+                .build());
+        return action;
+    }
+
+    private static GuidedAction addCheckedAction(List<GuidedAction> actions, long id,
+            String title, String desc, int checkSetId) {
+        GuidedAction action;
+        actions.add(action = new GuidedAction.Builder(null)
+                .id(id)
+                .title(title)
+                .description(desc)
+                .checkSetId(checkSetId)
+                .build());
+        return action;
+    }
+
+    public static class FirstStepFragment extends GuidedStepSupportFragment {
+
+        @Override
+        public int onProvideTheme() {
+            return R.style.Theme_Example_Leanback_GuidedStep_First;
+        }
+
+        @Override
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_first_title);
+            String breadcrumb = getString(R.string.guidedstep_first_breadcrumb);
+            String description = getString(R.string.guidedstep_first_description);
+            final Context context = getActivity();
+            Drawable icon = ResourcesCompat.getDrawable(context.getResources(),
+                    R.drawable.ic_main_icon, context.getTheme());
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            Context context = getActivity();
+            actions.add(new GuidedAction.Builder(context)
+                    .clickAction(GuidedAction.ACTION_ID_CONTINUE)
+                    .description("Let's do it")
+                    .build());
+            actions.add(new GuidedAction.Builder(context)
+                    .id(REFRESH)
+                    .title("Refresh")
+                    .build());
+            actions.add(new GuidedAction.Builder(context)
+                    .clickAction(GuidedAction.ACTION_ID_CANCEL)
+                    .description("Never mind")
+                    .build());
+        }
+
+        @Override
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
+            FragmentManager fm = getFragmentManager();
+            if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
+                GuidedStepSupportFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
+            } else if (action.getId() == REFRESH) {
+                // swap actions position and change content:
+                Context context = getActivity();
+                ArrayList<GuidedAction> newActions = new ArrayList();
+                newActions.add(new GuidedAction.Builder(context)
+                        .id(REFRESH)
+                        .title("Refresh done")
+                        .build());
+                newActions.add(new GuidedAction.Builder(context)
+                        .clickAction(GuidedAction.ACTION_ID_CONTINUE)
+                        .description("Let's do it")
+                        .build());
+                newActions.add(new GuidedAction.Builder(context)
+                        .clickAction(GuidedAction.ACTION_ID_CANCEL)
+                        .description("Never mind")
+                        .build());
+                setActions(newActions);
+            } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
+                finishGuidedStepSupportFragments();
+            }
+        }
+    }
+
+    public interface NewPaymentFragmentTarget {
+        void onNewPaymentFragmentStarted();
+        void onNewPaymentAdded(int selection);
+    }
+
+    static ArrayList<String> sCards = new ArrayList<String>();
+    static int sSelectedCard = -1;
+    static {
+        sCards.add("Visa-1234");
+        sCards.add("AmEx-4321");
+    }
+
+    public static class NewPaymentStepFragment extends GuidedStepSupportFragment {
+
+        NewPaymentFragmentTarget mNewPaymentTarget;
+
+        @Override
+        public void onCreate(@Nullable Bundle savedInstance) {
+            super.onCreate(savedInstance);
+            Fragment targetFragment = getTargetFragment();
+            if (targetFragment instanceof NewPaymentFragmentTarget) {
+                mNewPaymentTarget = ((NewPaymentFragmentTarget) targetFragment);
+                mNewPaymentTarget.onNewPaymentFragmentStarted();
+            }
+        }
+
+        @Override
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_newpayment_title);
+            String breadcrumb = getString(R.string.guidedstep_newpayment_breadcrumb);
+            String description = getString(R.string.guidedstep_newpayment_description);
+            final Context context = getActivity();
+            Drawable icon = ResourcesCompat.getDrawable(context.getResources(),
+                    R.drawable.ic_main_icon, context.getTheme());
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            addEditableAction(actions, NEW_PAYMENT, "Input credit card number", "",
+                    InputType.TYPE_CLASS_NUMBER,
+                    "Input credit card number", "Input credit card number");
+            addDatePickerAction(actions, PAYMENT_EXPIRE, "Exp:");
+        }
+
+        @Override
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            Context context = getActivity();
+            actions.add(new GuidedAction.Builder(context).clickAction(GuidedAction.ACTION_ID_OK)
+                    .build());
+            actions.get(actions.size() - 1).setEnabled(false);
+        }
+
+        @Override
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
+            if (action.getId() == GuidedAction.ACTION_ID_OK) {
+                CharSequence desc = findActionById(NEW_PAYMENT).getDescription();
+                String cardNumber = desc.subSequence(desc.length() - 4, desc.length()).toString();
+                String card;
+                if ((Integer.parseInt(cardNumber) & 1) == 0) {
+                    card = "Visa "+cardNumber;
+                } else {
+                    card = "AmEx "+cardNumber;
+                }
+                int selection = sCards.size();
+                sCards.add(card);
+                if (mNewPaymentTarget != null) {
+                    mNewPaymentTarget.onNewPaymentAdded(selection);
+                }
+                popBackStackToGuidedStepSupportFragment(NewPaymentStepFragment.class,
+                        FragmentManager.POP_BACK_STACK_INCLUSIVE);
+            }
+        }
+
+        @Override
+        public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
+            if (action.getId() == NEW_PAYMENT) {
+                CharSequence editTitle = action.getEditTitle();
+                if (isCardNumberValid(editTitle)) {
+                    editTitle = editTitle.subSequence(editTitle.length() - 4, editTitle.length());
+                    action.setDescription("Visa XXXX-XXXX-XXXX-" + editTitle);
+                    updateOkButton(isExpDateValid(findActionById(PAYMENT_EXPIRE)));
+                    return GuidedAction.ACTION_ID_NEXT;
+                } else if (editTitle.length() == 0) {
+                    action.setDescription("Input credit card number");
+                    updateOkButton(false);
+                    return GuidedAction.ACTION_ID_CURRENT;
+                } else {
+                    action.setDescription("Error credit card number");
+                    updateOkButton(false);
+                    return GuidedAction.ACTION_ID_CURRENT;
+                }
+            } else if (action.getId() == PAYMENT_EXPIRE) {
+                updateOkButton(isExpDateValid(action) &&
+                        isCardNumberValid(findActionById(NEW_PAYMENT).getEditTitle()));
+            }
+            return GuidedAction.ACTION_ID_NEXT;
+        }
+
+        boolean isCardNumberValid(CharSequence number) {
+            return TextUtils.isDigitsOnly(number) && number.length() == 16;
+        }
+
+        boolean isExpDateValid(GuidedAction action) {
+            long date = ((GuidedDatePickerAction) action).getDate();
+            Calendar c = Calendar.getInstance();
+            c.setTimeInMillis(date);
+            return Calendar.getInstance().before(c);
+        }
+
+        void updateOkButton(boolean enabled) {
+            findButtonActionById(GuidedAction.ACTION_ID_OK).setEnabled(enabled);
+            notifyButtonActionChanged(findButtonActionPositionById(GuidedAction.ACTION_ID_OK));
+        }
+    }
+
+    public static class SecondStepFragment extends GuidedStepSupportFragment
+            implements NewPaymentFragmentTarget {
+
+
+        boolean mExpandPaymentListInOnCreateView;
+
+        @Override
+        public void onNewPaymentAdded(int selection) {
+            // if a new payment is added, we don't need expand the sub actions list.
+            mExpandPaymentListInOnCreateView = false;
+            sSelectedCard = selection;
+            updatePaymentAction(findActionById(PAYMENT));
+            findButtonActionById(GuidedAction.ACTION_ID_CONTINUE).setEnabled(sSelectedCard != -1);
+        }
+
+        @Override
+        public void onNewPaymentFragmentStarted() {
+            // if a new payment fragment is opened, when come back we should expand the payment
+            // sub actions list unless user created a new payment in onNewPaymentAdded
+            mExpandPaymentListInOnCreateView = true;
+        }
+
+        @Override
+        @NonNull
+        public GuidedActionsStylist onCreateActionsStylist() {
+            return new GuidedActionsStylist() {
+                @Override
+                protected void setupImeOptions(GuidedActionsStylist.ViewHolder vh,
+                        GuidedAction action) {
+                    if (action.getId() == PASSWORD) {
+                        vh.getEditableDescriptionView().setImeActionLabel("Confirm!",
+                                EditorInfo.IME_ACTION_DONE);
+                    } else {
+                        super.setupImeOptions(vh, action);
+                    }
+                }
+            };
+        }
+
+        @Override
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_second_title);
+            String breadcrumb = getString(R.string.guidedstep_second_breadcrumb);
+            String description = getString(R.string.guidedstep_second_description);
+            final Context context = getActivity();
+            Drawable icon = ResourcesCompat.getDrawable(context.getResources(),
+                    R.drawable.ic_main_icon, context.getTheme());
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            addEditableAction(getActivity(), actions, FIRST_NAME, "Pat", "Your first name");
+            addEditableAction(getActivity(), actions, LAST_NAME, "Smith", "Your last name");
+            List<GuidedAction> subActions = new ArrayList<GuidedAction>();
+            updatePaymentAction(addAction(actions, PAYMENT, "Select Payment", "", subActions));
+            addEditableDescriptionAction(actions, PASSWORD, "Password", "", "",
+                    InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+        }
+
+        @Override
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            actions.add(new GuidedAction.Builder(getActivity())
+                    .clickAction(GuidedAction.ACTION_ID_CONTINUE)
+                    .description("Continue")
+                    .enabled(isPasswordValid() && isPaymentValid())
+                    .build());
+        }
+
+        @Override
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
+            if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
+                FragmentManager fm = getFragmentManager();
+                GuidedStepSupportFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
+            }
+        }
+
+        void updatePaymentAction(GuidedAction paymentAction) {
+            List<GuidedAction> subActions = paymentAction.getSubActions();
+            subActions.clear();
+            for (int i = 0; i < sCards.size(); i++) {
+                addCheckedAction(subActions, -1, sCards.get(i), "",
+                        GuidedAction.DEFAULT_CHECK_SET_ID);
+                if (i == sSelectedCard) {
+                    subActions.get(i).setChecked(true);
+                }
+            }
+            addAction(subActions, NEW_PAYMENT, "Add New Card", "");
+            paymentAction.setDescription(sSelectedCard == -1 ? "" : sCards.get(sSelectedCard));
+        }
+
+        @Override
+        public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
+            if (action.getId() == PASSWORD) {
+                CharSequence password = action.getEditDescription();
+                if (password.length() > 0) {
+                    if (isPaymentValid()) {
+                        updateContinue(true);
+                        return GuidedAction.ACTION_ID_NEXT;
+                    } else {
+                        updateContinue(false);
+                        return GuidedAction.ACTION_ID_CURRENT;
+                    }
+                } else {
+                    updateContinue(false);
+                    return GuidedAction.ACTION_ID_CURRENT;
+                }
+            }
+            return GuidedAction.ACTION_ID_NEXT;
+        }
+
+        @Override
+        public boolean onSubGuidedActionClicked(@NonNull GuidedAction action) {
+            if (action.isChecked()) {
+                String payment = action.getTitle().toString();
+                for (int i = 0; i < sCards.size(); i++) {
+                    if (payment.equals(sCards.get(i))) {
+                        sSelectedCard = i;
+                        findActionById(PAYMENT).setDescription(payment);
+                        notifyActionChanged(findActionPositionById(PAYMENT));
+                        updateContinue(isPasswordValid());
+                        break;
+                    }
+                }
+                return true;
+            } else {
+                FragmentManager fm = getFragmentManager();
+                NewPaymentStepFragment newPaymentFragment = new NewPaymentStepFragment();
+                newPaymentFragment.setTargetFragment(this, 0);
+                GuidedStepSupportFragment.add(fm, newPaymentFragment, R.id.lb_guidedstep_host);
+                return false;
+            }
+        }
+
+        @Override
+        @Nullable
+        public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container,
+                @Nullable Bundle savedInstanceState) {
+            View view = super.onCreateView(inflater, container, savedInstanceState);
+            if (mExpandPaymentListInOnCreateView) {
+                expandAction(findActionById(PAYMENT), false);
+            }
+            return view;
+        }
+
+        boolean isPaymentValid() {
+            CharSequence paymentType = findActionById(PAYMENT).getDescription();
+            return (paymentType.length() >= 4 &&
+                    paymentType.subSequence(0, 4).toString().equals("Visa")) ||
+                    (paymentType.length() >= 4 &&
+                    paymentType.subSequence(0, 4).toString().equals("AmEx"));
+        }
+
+        boolean isPasswordValid() {
+            return findActionById(PASSWORD).getEditDescription().length() > 0;
+        }
+
+        void updateContinue(boolean enabled) {
+            findButtonActionById(GuidedAction.ACTION_ID_CONTINUE).setEnabled(enabled);
+            notifyButtonActionChanged(findButtonActionPositionById(
+                    GuidedAction.ACTION_ID_CONTINUE));
+        }
+    }
+
+    public static class ThirdStepFragment extends GuidedStepSupportFragment {
+
+        private long mSelectedOption = DEFAULT_OPTION;
+
+        @Override
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_third_title);
+            String breadcrumb = getString(R.string.guidedstep_third_breadcrumb);
+            String description = getString(R.string.guidedstep_third_description);
+            final Context context = getActivity();
+            Drawable icon = ResourcesCompat.getDrawable(context.getResources(),
+                    R.drawable.ic_main_icon, context.getTheme());
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        @NonNull
+        public GuidanceStylist onCreateGuidanceStylist() {
+            return new GuidanceStylist() {
+                @Override
+                public int onProvideLayoutId() {
+                    return R.layout.guidedstep_second_guidance;
+                }
+            };
+        }
+
+        @Override
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            String desc = "The description can be quite long as well.  "
+                    + "Just be sure to set multilineDescription to true in the GuidedAction."
+                    + "For testing purpose we make this line even longer since "
+                    + "multilineDescriptionMinLines will be set to 2.";
+            actions.add(new GuidedAction.Builder(getActivity())
+                    .title("Note that Guided Actions can have titles that are quite long.")
+                    .description(desc)
+                    .multilineDescription(true)
+                    .infoOnly(true)
+                    .enabled(true)
+                    .focusable(false)
+                    .build());
+            for (int i = 0; i < OPTION_NAMES.length; i++) {
+                addCheckedAction(actions, RADIO_ID_BASE + i, OPTION_NAMES[i],
+                        OPTION_DESCRIPTIONS[i], GuidedAction.DEFAULT_CHECK_SET_ID);
+                if (i == DEFAULT_OPTION) {
+                    actions.get(actions.size() -1).setChecked(true);
+                }
+            }
+            for (int i = 0; i < OPTION_NAMES.length; i++) {
+                addCheckedAction(actions, CHECKBOX_ID_BASE + i, OPTION_NAMES[i],
+                        OPTION_DESCRIPTIONS[i], GuidedAction.CHECKBOX_CHECK_SET_ID);
+            }
+        }
+
+        @Override
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            actions.add(new GuidedAction.Builder(getActivity())
+                    .clickAction(GuidedAction.ACTION_ID_CONTINUE)
+                    .build());
+        }
+
+        @Override
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
+            if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
+                FragmentManager fm = getFragmentManager();
+                FourthStepFragment f = new FourthStepFragment();
+                Bundle arguments = new Bundle();
+                arguments.putLong(FourthStepFragment.EXTRA_OPTION, mSelectedOption);
+                f.setArguments(arguments);
+                GuidedStepSupportFragment.add(fm, f, R.id.lb_guidedstep_host);
+            } else if (action.getCheckSetId() == GuidedAction.DEFAULT_CHECK_SET_ID) {
+                mSelectedOption = action.getId();
+            }
+        }
+
+    }
+
+    public static class FourthStepFragment extends GuidedStepSupportFragment {
+        public static final String EXTRA_OPTION = "extra_option";
+
+        public FourthStepFragment() {
+        }
+
+        public long getOption() {
+            Bundle b = getArguments();
+            if (b == null) return 0;
+            return b.getLong(EXTRA_OPTION, 0);
+        }
+
+        @Override
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_fourth_title);
+            String breadcrumb = getString(R.string.guidedstep_fourth_breadcrumb);
+            String description = "You chose: " + OPTION_NAMES[(int) getOption()];
+            final Context context = getActivity();
+            Drawable icon = ResourcesCompat.getDrawable(context.getResources(),
+                    R.drawable.ic_main_icon, context.getTheme());
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
+            actions.add(new GuidedAction.Builder(getActivity())
+                    .clickAction(GuidedAction.ACTION_ID_FINISH)
+                    .description("All Done...")
+                    .build());
+            addAction(actions, BACK, "Start Over", "Let's try this again...");
+        }
+
+        @Override
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
+            if (action.getId() == GuidedAction.ACTION_ID_FINISH) {
+                finishGuidedStepSupportFragments();
+            } else if (action.getId() == BACK) {
+                // pop 4, 3, 2
+                popBackStackToGuidedStepSupportFragment(SecondStepFragment.class,
+                        FragmentManager.POP_BACK_STACK_INCLUSIVE);
+            }
+        }
+
+    }
+
+}
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepHalfScreenActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepHalfScreenActivity.java
index 1a7c5b9..b7cd6de 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepHalfScreenActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepHalfScreenActivity.java
@@ -23,6 +23,8 @@
 import android.os.Bundle;
 import android.util.Log;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.core.content.res.ResourcesCompat;
 import androidx.leanback.app.GuidedStepFragment;
 import androidx.leanback.widget.GuidanceStylist.Guidance;
@@ -60,7 +62,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context)
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
@@ -88,7 +91,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 GuidedStepFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
@@ -117,7 +120,8 @@
         }
 
         @Override
-        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context)
                     .clickAction(GuidedAction.ACTION_ID_FINISH)
@@ -130,7 +134,8 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_CANCEL)
                     .description("Cancel")
@@ -138,7 +143,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             fm.popBackStack();
         }
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportActivity.java
index e8a2376..64f7abb 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportActivity.java
@@ -19,6 +19,9 @@
 
 package com.example.android.leanback;
 
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.graphics.drawable.Drawable;
@@ -34,9 +37,6 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.core.content.res.ResourcesCompat;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentActivity;
-import androidx.fragment.app.FragmentManager;
 import androidx.leanback.app.GuidedStepSupportFragment;
 import androidx.leanback.widget.GuidanceStylist;
 import androidx.leanback.widget.GuidanceStylist.Guidance;
@@ -75,29 +75,30 @@
     private static final String TAG = GuidedStepSupportActivity.class.getSimpleName();
 
     @Override
-    protected void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
         Log.v(TAG, "onCreate");
         super.onCreate(savedInstanceState);
         setContentView(R.layout.guided_step_activity);
         if (savedInstanceState == null) {
-            GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
+            GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(),
+                    R.id.lb_guidedstep_host);
         }
     }
 
     @Override
-    public void onConfigurationChanged(Configuration newConfig) {
+    public void onConfigurationChanged(@Nullable Configuration newConfig) {
         Log.v(TAG, "onConfigurationChanged");
         super.onConfigurationChanged(newConfig);
     }
 
     @Override
-    protected void onSaveInstanceState(Bundle outState) {
+    protected void onSaveInstanceState(@Nullable Bundle outState) {
         Log.v(TAG, "onSaveInstanceState");
         super.onSaveInstanceState(outState);
     }
 
     @Override
-    protected void onRestoreInstanceState(Bundle savedInstanceState) {
+    protected void onRestoreInstanceState(@Nullable Bundle savedInstanceState) {
         Log.v(TAG, "onRestoreInstanceState");
         super.onRestoreInstanceState(savedInstanceState);
     }
@@ -197,8 +198,8 @@
             return R.style.Theme_Example_Leanback_GuidedStep_First;
         }
 
-        @NonNull
         @Override
+        @NonNull
         public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_first_title);
             String breadcrumb = getString(R.string.guidedstep_first_breadcrumb);
@@ -210,7 +211,8 @@
         }
 
         @Override
-        public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context)
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
@@ -227,7 +229,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 GuidedStepSupportFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
@@ -247,7 +249,6 @@
                         .clickAction(GuidedAction.ACTION_ID_CANCEL)
                         .description("Never mind")
                         .build());
-                //setActionsDiffCallback(null);
                 setActions(newActions);
             } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
                 finishGuidedStepSupportFragments();
@@ -272,7 +273,7 @@
         NewPaymentFragmentTarget mNewPaymentTarget;
 
         @Override
-        public void onCreate(Bundle savedInstance) {
+        public void onCreate(@Nullable Bundle savedInstance) {
             super.onCreate(savedInstance);
             Fragment targetFragment = getTargetFragment();
             if (targetFragment instanceof NewPaymentFragmentTarget) {
@@ -281,9 +282,9 @@
             }
         }
 
-        @NonNull
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_newpayment_title);
             String breadcrumb = getString(R.string.guidedstep_newpayment_breadcrumb);
             String description = getString(R.string.guidedstep_newpayment_description);
@@ -294,7 +295,8 @@
         }
 
         @Override
-        public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             addEditableAction(actions, NEW_PAYMENT, "Input credit card number", "",
                     InputType.TYPE_CLASS_NUMBER,
                     "Input credit card number", "Input credit card number");
@@ -302,7 +304,8 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context).clickAction(GuidedAction.ACTION_ID_OK)
                     .build());
@@ -310,7 +313,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_OK) {
                 CharSequence desc = findActionById(NEW_PAYMENT).getDescription();
                 String cardNumber = desc.subSequence(desc.length() - 4, desc.length()).toString();
@@ -331,7 +334,7 @@
         }
 
         @Override
-        public long onGuidedActionEditedAndProceed(GuidedAction action) {
+        public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
             if (action.getId() == NEW_PAYMENT) {
                 CharSequence editTitle = action.getEditTitle();
                 if (isCardNumberValid(editTitle)) {
@@ -380,7 +383,7 @@
 
         @Override
         public void onNewPaymentAdded(int selection) {
-            // if a new payment is added, we dont need expand the sub actions list.
+            // if a new payment is added, we don't need expand the sub actions list.
             mExpandPaymentListInOnCreateView = false;
             sSelectedCard = selection;
             updatePaymentAction(findActionById(PAYMENT));
@@ -395,6 +398,7 @@
         }
 
         @Override
+        @NonNull
         public GuidedActionsStylist onCreateActionsStylist() {
             return new GuidedActionsStylist() {
                 @Override
@@ -410,9 +414,9 @@
             };
         }
 
-        @NonNull
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_second_title);
             String breadcrumb = getString(R.string.guidedstep_second_breadcrumb);
             String description = getString(R.string.guidedstep_second_description);
@@ -423,7 +427,8 @@
         }
 
         @Override
-        public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             addEditableAction(getActivity(), actions, FIRST_NAME, "Pat", "Your first name");
             addEditableAction(getActivity(), actions, LAST_NAME, "Smith", "Your last name");
             List<GuidedAction> subActions = new ArrayList<GuidedAction>();
@@ -433,7 +438,8 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
                     .description("Continue")
@@ -442,7 +448,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 FragmentManager fm = getFragmentManager();
                 GuidedStepSupportFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
@@ -464,7 +470,7 @@
         }
 
         @Override
-        public long onGuidedActionEditedAndProceed(GuidedAction action) {
+        public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
             if (action.getId() == PASSWORD) {
                 CharSequence password = action.getEditDescription();
                 if (password.length() > 0) {
@@ -484,7 +490,7 @@
         }
 
         @Override
-        public boolean onSubGuidedActionClicked(GuidedAction action) {
+        public boolean onSubGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.isChecked()) {
                 String payment = action.getTitle().toString();
                 for (int i = 0; i < sCards.size(); i++) {
@@ -507,8 +513,9 @@
         }
 
         @Override
-        public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                Bundle savedInstanceState) {
+        @Nullable
+        public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container,
+                @Nullable Bundle savedInstanceState) {
             View view = super.onCreateView(inflater, container, savedInstanceState);
             if (mExpandPaymentListInOnCreateView) {
                 expandAction(findActionById(PAYMENT), false);
@@ -539,9 +546,9 @@
 
         private long mSelectedOption = DEFAULT_OPTION;
 
-        @NonNull
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_third_title);
             String breadcrumb = getString(R.string.guidedstep_third_breadcrumb);
             String description = getString(R.string.guidedstep_third_description);
@@ -552,6 +559,7 @@
         }
 
         @Override
+        @NonNull
         public GuidanceStylist onCreateGuidanceStylist() {
             return new GuidanceStylist() {
                 @Override
@@ -562,7 +570,8 @@
         }
 
         @Override
-        public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             String desc = "The description can be quite long as well.  "
                     + "Just be sure to set multilineDescription to true in the GuidedAction."
                     + "For testing purpose we make this line even longer since "
@@ -589,14 +598,15 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
                     .build());
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 FragmentManager fm = getFragmentManager();
                 FourthStepFragment f = new FourthStepFragment();
@@ -623,9 +633,9 @@
             return b.getLong(EXTRA_OPTION, 0);
         }
 
-        @NonNull
         @Override
-        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+        @NonNull
+        public Guidance onCreateGuidance(@Nullable Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_fourth_title);
             String breadcrumb = getString(R.string.guidedstep_fourth_breadcrumb);
             String description = "You chose: " + OPTION_NAMES[(int) getOption()];
@@ -636,7 +646,8 @@
         }
 
         @Override
-        public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_FINISH)
                     .description("All Done...")
@@ -645,7 +656,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_FINISH) {
                 finishGuidedStepSupportFragments();
             } else if (action.getId() == BACK) {
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportHalfScreenActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportHalfScreenActivity.java
index 07fce9c..891665e 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportHalfScreenActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/GuidedStepSupportHalfScreenActivity.java
@@ -19,6 +19,8 @@
 
 package com.example.android.leanback;
 
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
@@ -27,8 +29,6 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.core.content.res.ResourcesCompat;
-import androidx.fragment.app.FragmentActivity;
-import androidx.fragment.app.FragmentManager;
 import androidx.leanback.app.GuidedStepSupportFragment;
 import androidx.leanback.widget.GuidanceStylist.Guidance;
 import androidx.leanback.widget.GuidedAction;
@@ -53,7 +53,6 @@
 
     public static class FirstStepFragment extends GuidedStepSupportFragment {
 
-       @NonNull
        @Override
         public Guidance onCreateGuidance(Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_first_title);
@@ -66,10 +65,8 @@
         }
 
         @Override
-        public void onCreateActions(
-                @NonNull List<GuidedAction> actions,
-                @Nullable Bundle savedInstanceState
-        ) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context)
                     .clickAction(GuidedAction.ACTION_ID_CONTINUE)
@@ -97,7 +94,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 GuidedStepSupportFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
@@ -114,7 +111,6 @@
             return R.style.Theme_Example_Leanback_GuidedStep_Half;
         }
 
-        @NonNull
         @Override
         public Guidance onCreateGuidance(Bundle savedInstanceState) {
             String title = getString(R.string.guidedstep_second_title);
@@ -127,7 +123,8 @@
         }
 
         @Override
-        public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             Context context = getActivity();
             actions.add(new GuidedAction.Builder(context)
                     .clickAction(GuidedAction.ACTION_ID_FINISH)
@@ -140,7 +137,8 @@
         }
 
         @Override
-        public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+        public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
+                @Nullable Bundle savedInstanceState) {
             actions.add(new GuidedAction.Builder(getActivity())
                     .clickAction(GuidedAction.ACTION_ID_CANCEL)
                     .description("Cancel")
@@ -148,7 +146,7 @@
         }
 
         @Override
-        public void onGuidedActionClicked(GuidedAction action) {
+        public void onGuidedActionClicked(@NonNull GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             fm.popBackStack();
         }
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MainActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MainActivity.java
index 95d185c..5bc3083 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MainActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MainActivity.java
@@ -115,6 +115,8 @@
                     R.string.guidedstep_description);
             addAction(actions, GuidedStepSupportActivity.class, R.string.guidedstepsupport,
                     R.string.guidedstepsupport_description);
+            addAction(actions, GuidedStepAppCompatActivity.class, R.string.guidedstepappcompat,
+                    R.string.guidedstepappcompat_description);
             addAction(actions, GuidedStepHalfScreenActivity.class, R.string.guidedstephalfscreen,
                     R.string.guidedstep_description);
             addAction(actions, GuidedStepSupportHalfScreenActivity.class,
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoFragment.java
index b83342b..17bed3a 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoFragment.java
@@ -23,6 +23,8 @@
 import android.view.ViewGroup;
 import android.widget.ImageView;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.leanback.app.OnboardingFragment;
 
 import java.util.ArrayList;
@@ -83,7 +85,9 @@
     }
 
     @Override
-    protected View onCreateContentView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
+    @Nullable
+    protected View onCreateContentView(@NonNull LayoutInflater layoutInflater,
+            @NonNull ViewGroup viewGroup) {
         mContentView = layoutInflater.inflate(R.layout.onboarding_content, viewGroup, false);
         mContentBackgroundView = (ImageView) mContentView.findViewById(R.id.background_image);
         mContentAnimationView = (ImageView) mContentView.findViewById(R.id.animation_image);
@@ -91,7 +95,9 @@
     }
 
     @Override
-    protected View onCreateForegroundView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
+    @Nullable
+    protected View onCreateForegroundView(@NonNull LayoutInflater layoutInflater,
+            @NonNull ViewGroup viewGroup) {
         return null;
     }
 
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoSupportFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoSupportFragment.java
index 3375ab5..25928cd 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoSupportFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingDemoSupportFragment.java
@@ -27,6 +27,7 @@
 import android.widget.ImageView;
 
 import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.leanback.app.OnboardingSupportFragment;
 
 import java.util.ArrayList;
@@ -81,15 +82,15 @@
     }
 
     @Override
-    protected View onCreateBackgroundView(
-            @NonNull LayoutInflater layoutInflater, @NonNull ViewGroup viewGroup) {
+    protected View onCreateBackgroundView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
         mBackgroundView = layoutInflater.inflate(R.layout.onboarding_image, viewGroup, false);
         return mBackgroundView;
     }
 
     @Override
-    protected View onCreateContentView(
-            @NonNull LayoutInflater layoutInflater, @NonNull ViewGroup viewGroup) {
+    @Nullable
+    protected View onCreateContentView(@NonNull LayoutInflater layoutInflater,
+            @NonNull ViewGroup viewGroup) {
         mContentView = layoutInflater.inflate(R.layout.onboarding_content, viewGroup, false);
         mContentBackgroundView = (ImageView) mContentView.findViewById(R.id.background_image);
         mContentAnimationView = (ImageView) mContentView.findViewById(R.id.animation_image);
@@ -97,8 +98,9 @@
     }
 
     @Override
-    protected View onCreateForegroundView(
-            @NonNull LayoutInflater layoutInflater, @NonNull ViewGroup viewGroup) {
+    @Nullable
+    protected View onCreateForegroundView(@NonNull LayoutInflater layoutInflater,
+            @NonNull ViewGroup viewGroup) {
         return null;
     }
 
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingSupportActivity.java
index ddd865b..9677b11 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/OnboardingSupportActivity.java
@@ -16,9 +16,8 @@
  */
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 public class OnboardingSupportActivity extends FragmentActivity {
     @Override
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackSupportActivity.java
index f29099c..76002b0 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackSupportActivity.java
@@ -19,9 +19,8 @@
 
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackTransportControlSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackTransportControlSupportActivity.java
index 828b045..6483882 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackTransportControlSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/PlaybackTransportControlSupportActivity.java
@@ -19,9 +19,8 @@
 
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsFragment.java
index 7d11911..4948393 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsFragment.java
@@ -17,8 +17,11 @@
 import android.os.Bundle;
 import android.util.Log;
 
+import androidx.annotation.NonNull;
 import androidx.core.app.ActivityOptionsCompat;
+import androidx.leanback.paging.PagingDataAdapter;
 import androidx.leanback.widget.ArrayObjectAdapter;
+import androidx.leanback.widget.ClassPresenterSelector;
 import androidx.leanback.widget.HeaderItem;
 import androidx.leanback.widget.ImageCardView;
 import androidx.leanback.widget.ListRow;
@@ -29,6 +32,7 @@
 import androidx.leanback.widget.Row;
 import androidx.leanback.widget.RowPresenter;
 import androidx.leanback.widget.TitleHelper;
+import androidx.recyclerview.widget.DiffUtil;
 
 public class RowsFragment extends androidx.leanback.app.RowsFragment {
 
@@ -65,7 +69,9 @@
     }
 
     private void setupRows() {
+        ClassPresenterSelector cs = new ClassPresenterSelector();
         ListRowPresenter lrp = new ListRowPresenter();
+        PagedRowPresenter prp = new PagedRowPresenter();
 
         // For good performance, it's important to use a single instance of
         // a card presenter for all rows using that presenter.
@@ -74,9 +80,11 @@
         if (USE_FIXED_ROW_HEIGHT) {
             lrp.setRowHeight(cardPresenter.getRowHeight(getActivity()));
             lrp.setExpandedRowHeight(cardPresenter.getExpandedRowHeight(getActivity()));
+            prp.setRowHeight(cardPresenter.getRowHeight(getActivity()));
+            prp.setExpandedRowHeight(cardPresenter.getExpandedRowHeight(getActivity()));
         }
 
-        ArrayObjectAdapter rowsAdapter = new ArrayObjectAdapter(lrp);
+        ArrayObjectAdapter rowsAdapter = new ArrayObjectAdapter(cs);
 
         for (int i = 0; i < NUM_ROWS; ++i) {
             ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
@@ -92,6 +100,9 @@
             rowsAdapter.add(new ListRow(header, listRowAdapter));
         }
 
+        rowsAdapter.add(getLiveDataRow(NUM_ROWS, cardPresenter));
+        cs.addClassPresenter(ListRow.class, lrp);
+        cs.addClassPresenter(LiveDataListRow.class, prp);
         setAdapter(rowsAdapter);
     }
 
@@ -99,14 +110,34 @@
         @Override
         public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                 RowPresenter.ViewHolder rowViewHolder, Row row) {
-            Intent intent = new Intent(getActivity(), DetailsActivity.class);
-            intent.putExtra(DetailsActivity.EXTRA_ITEM, (PhotoItem) item);
+            Intent intent = new Intent(getActivity(), DetailsSupportActivity.class);
+            intent.putExtra(DetailsSupportActivity.EXTRA_ITEM, (PhotoItem) item);
 
             Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                     getActivity(),
-                    ((ImageCardView)itemViewHolder.view).getMainImageView(),
-                    DetailsActivity.SHARED_ELEMENT_NAME).toBundle();
+                    ((ImageCardView) itemViewHolder.view).getMainImageView(),
+                    DetailsSupportActivity.SHARED_ELEMENT_NAME).toBundle();
             getActivity().startActivity(intent, bundle);
         }
     }
+
+    private ListRow getLiveDataRow(int index, CardPresenter cardPresenter) {
+        PagingDataAdapter<PhotoItem> pagedListAdapter =
+                new PagingDataAdapter<PhotoItem>(cardPresenter,
+                        new DiffUtil.ItemCallback<PhotoItem>() {
+                            @Override
+                            public boolean areItemsTheSame(@NonNull PhotoItem oldItem,
+                                    @NonNull PhotoItem newItem) {
+                                return oldItem.getId() == newItem.getId();
+                            }
+                            @Override
+                            public boolean areContentsTheSame(@NonNull PhotoItem oldItem,
+                                    @NonNull PhotoItem newItem) {
+                                return oldItem.equals(newItem);
+                            }
+                        });
+
+        HeaderItem header = new HeaderItem(index, "Row with paging data adapter");
+        return new LiveDataListRow(header, pagedListAdapter);
+    }
 }
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportActivity.java
index 2985e76..0767089 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportActivity.java
@@ -16,11 +16,11 @@
  */
 package com.example.android.leanback;
 
+import androidx.fragment.app.FragmentActivity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 
-import androidx.fragment.app.FragmentActivity;
 import androidx.leanback.widget.BrowseFrameLayout;
 import androidx.leanback.widget.TitleHelper;
 import androidx.leanback.widget.TitleView;
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportFragment.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportFragment.java
index ec5f2bc..1e1596b 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportFragment.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/RowsSupportFragment.java
@@ -1,5 +1,6 @@
 // CHECKSTYLE:OFF Generated code
 /* This file is auto-generated from RowsFragment.java.  DO NOT MODIFY. */
+
 /*
  * Copyright (C) 2014 The Android Open Source Project
  *
@@ -41,7 +42,6 @@
     private static final String TAG = "leanback.RowsSupportFragment";
 
     private static final int NUM_ROWS = 10;
-
     // Row heights default to wrap content
     private static final boolean USE_FIXED_ROW_HEIGHT = false;
 
@@ -55,6 +55,7 @@
     public void onCreate(Bundle savedInstanceState) {
         Log.i(TAG, "onCreate");
         super.onCreate(savedInstanceState);
+
         setupRows();
         setOnItemViewClickedListener(new ItemViewClickedListener());
         setOnItemViewSelectedListener(new OnItemViewSelectedListener() {
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchActivity.java
index 2b12cc0..c66e915 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchActivity.java
@@ -59,6 +59,7 @@
         if (DEBUG) Log.v(TAG, "onActivityResult requestCode=" + requestCode +
                 " resultCode=" + resultCode +
                 " data=" + data);
+        super.onActivityResult(requestCode, resultCode, data);
         if (requestCode == REQUEST_SPEECH && resultCode == RESULT_OK) {
             mFragment.setSearchQuery(data, true);
         }
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchSupportActivity.java
index 8d47e01..9e00eb8 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchSupportActivity.java
@@ -16,11 +16,11 @@
  */
 package com.example.android.leanback;
 
+import androidx.fragment.app.FragmentActivity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.util.Log;
 
-import androidx.fragment.app.FragmentActivity;
 import androidx.leanback.app.SearchSupportFragment;
 import androidx.leanback.widget.SpeechRecognitionCallback;
 
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VerticalGridSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VerticalGridSupportActivity.java
index 6f5cca56..799afd7 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VerticalGridSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VerticalGridSupportActivity.java
@@ -16,9 +16,8 @@
  */
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 public class VerticalGridSupportActivity extends FragmentActivity
 {
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VideoSupportActivity.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VideoSupportActivity.java
index d4358c0..c777a94 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VideoSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VideoSupportActivity.java
@@ -16,9 +16,8 @@
  */
 package com.example.android.leanback;
 
-import android.os.Bundle;
-
 import androidx.fragment.app.FragmentActivity;
+import android.os.Bundle;
 
 /**
  * Activity demonstrating the use of {@link androidx.leanback.app.VideoFragment}
diff --git a/samples/SupportLeanbackDemos/src/main/res/values/strings.xml b/samples/SupportLeanbackDemos/src/main/res/values/strings.xml
index 32b2cb7..9240cd8 100644
--- a/samples/SupportLeanbackDemos/src/main/res/values/strings.xml
+++ b/samples/SupportLeanbackDemos/src/main/res/values/strings.xml
@@ -67,8 +67,10 @@
     <string name="guidedstephalfscreen">Guided Step Half Screen</string>
     <string name="guidedstep_description">GuidedStepFragment test</string>
     <string name="guidedstepsupport">Guided Step(support version)</string>
+    <string name="guidedstepappcompat">Guided Step(AppCompat version)</string>
     <string name="guidedstepsupporthalfscreen">Guided Step Half Screen(support version)</string>
     <string name="guidedstepsupport_description">GuidedStepSupportFragment test</string>
+    <string name="guidedstepappcompat_description">GuidedStepSupportFragment with AppCompat test</string>
     <string name="browseerror">Browse Error</string>
     <string name="browseerror_description">BrowseError test</string>
     <string name="browseerror_support">Browse ErrorFragment(support version)</string>