public NotificationGuts(Context context, AttributeSet attrs) {
super(context, attrs);
setWillNotDraw(false);
- TunerService.get(mContext).addTunable(this, SHOW_SLIDER);
mHandler = new Handler();
mFalsingCheck = new Runnable() {
@Override
ta.recycle();
}
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ TunerService.get(mContext).addTunable(this, SHOW_SLIDER);
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ TunerService.get(mContext).removeTunable(this);
+ super.onDetachedFromWindow();
+ }
+
public void resetFalsingCheck() {
mHandler.removeCallbacks(mFalsingCheck);
if (mNeedsFalsingProtection && mExposed) {