Fixes a bug when using the prediction row view and changing screen orientation.

Bug: 68713881
Change-Id: I9740eee8425d42af87c8c788aefff9a99ae48d2f
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 2bb95cb..eb4c9b2 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -543,6 +543,9 @@
     }
 
     private void setupHeader() {
+        if (mFloatingHeaderHandler == null) {
+            return;
+        }
         mHeader.setVisibility(View.VISIBLE);
         int contentHeight = mLauncher.getDeviceProfile().allAppsCellHeightPx;
         if (!mUsingTabs) {
diff --git a/src/com/android/launcher3/allapps/PredictionRowView.java b/src/com/android/launcher3/allapps/PredictionRowView.java
index 45ef6c1..ea91770 100644
--- a/src/com/android/launcher3/allapps/PredictionRowView.java
+++ b/src/com/android/launcher3/allapps/PredictionRowView.java
@@ -68,7 +68,10 @@
      * Sets the number of apps per row.
      */
     public void setNumAppsPerRow(int numPredictedAppsPerRow) {
-        mNumPredictedAppsPerRow = numPredictedAppsPerRow;
+        if (mNumPredictedAppsPerRow != numPredictedAppsPerRow) {
+            mNumPredictedAppsPerRow = numPredictedAppsPerRow;
+            onAppsUpdated();
+        }
     }
 
     /**