Bug 1396407 - [lint] Fix AlertDialog.Builder.setView call to support pre-r21. r=liuche
authorChenxia Liu <liuche@mozilla.com>
Sun, 03 Sep 2017 10:03:10 -0700
changeset 427989 3d3f96564e3ef6761ea216c103e748089e35a764
parent 427988 0991b275888d200772a54f624a814f0c6060d394
child 427990 0be1d1ac3bdc9daea2be077ea53139f5ee6b7bd4
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs1396407
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1396407 - [lint] Fix AlertDialog.Builder.setView call to support pre-r21. r=liuche MozReview-Commit-ID: IDJY3sDU9g
mobile/android/base/java/org/mozilla/gecko/preferences/TopSitesPanelsPreference.java
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/TopSitesPanelsPreference.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/TopSitesPanelsPreference.java
@@ -1,25 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.preferences;
 
 import android.app.AlertDialog;
 import android.content.Context;
+import android.view.LayoutInflater;
 
 import org.mozilla.gecko.R;
 
 /**
  * Custom preference that also adds additional options to the dialog of preferences for Top Sites settings.
  */
 public class TopSitesPanelsPreference extends PanelsPreference {
 
     TopSitesPanelsPreference(Context context, CustomListCategory parentCategory, boolean isRemovable, int index, boolean animate) {
         super(context, parentCategory, isRemovable, index, animate);
     }
 
     @Override
     protected void configureDialogBuilder(AlertDialog.Builder builder) {
+        final LayoutInflater inflater = LayoutInflater.from(getContext());
         builder.setView(R.layout.preference_topsites_panel_dialog);
+        builder.setView(inflater.inflate(R.layout.preference_topsites_panel_dialog, null));
     }
-}
+}
\ No newline at end of file