Bug 1312719 - Clear icon by setIcon with null drawable before setIcon with resId, r=sebastian
authormaliu <max@mxli.us>
Sat, 05 Nov 2016 19:18:59 +0800
changeset 366666 a14ca8dbcc4b3e9475273f9327c4826e6b3a9130
parent 366665 c8bca2404d0b9c6ef85cf0e4197dea3405f9447f
child 366667 d8528906686e36ee960249dd9131020768b1476c
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1312719
milestone52.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 1312719 - Clear icon by setIcon with null drawable before setIcon with resId, r=sebastian MozReview-Commit-ID: LTUMIoANQw7
mobile/android/base/java/org/mozilla/gecko/preferences/SyncPreference.java
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/SyncPreference.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/SyncPreference.java
@@ -50,16 +50,19 @@ class SyncPreference extends Preference 
             ThreadUtils.postToUiThread(new Runnable() {
                 @Override
                 public void run() {
                     setTitle(R.string.pref_sync);
                     setSummary(R.string.pref_sync_summary);
                         // Cancel any pending task.
                         Picasso.with(mContext).cancelRequest(profileAvatarTarget);
                         // Clear previously set icon.
+                        // Bug 1312719 - IconDrawable is prior to IconResId, drawable must be set null before setIcon(resId)
+                        // http://androidxref.com/5.1.1_r6/xref/frameworks/base/core/java/android/preference/Preference.java#562
+                        setIcon(null);
                         setIcon(R.drawable.sync_avatar_default);
                 }
             });
             return;
         }
 
         // Update title from account email.
         ThreadUtils.postToUiThread(new Runnable() {