diff --git a/mobile/android/base/AboutHomePromoBox.java b/mobile/android/base/AboutHomePromoBox.java index 227f0b794572..d7a0dfab5e37 100644 --- a/mobile/android/base/AboutHomePromoBox.java +++ b/mobile/android/base/AboutHomePromoBox.java @@ -50,6 +50,14 @@ public class AboutHomePromoBox extends TextView implements View.OnClickListener return true; } public void onClick(View v) { } + public void onDestroy() { } + } + + @Override + protected void onDetachedFromWindow() { + for (Type type : mTypes) { + type.onDestroy(); + } } private class SyncType extends Type { @@ -75,6 +83,7 @@ public class AboutHomePromoBox extends TextView implements View.OnClickListener context.startActivity(intent); } + @Override public void onDestroy() { if (mAccountListener != null) { AccountManager.get(mContext).removeOnAccountsUpdatedListener(mAccountListener);