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 321561 a14ca8dbcc4b
parent 321560 c8bca2404d0b
child 321562 d8528906686e
push id34025
push usercbook@mozilla.com
push dateTue, 08 Nov 2016 13:19:44 +0000
treeherderautoland@a14ca8dbcc4b [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() {