super(context, attrs); TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.VolumePreference, 0, 0); mStreamType = a.getInt(android.R.styleable.VolumePreference_streamType, 0); a.recycle();
Do clean up. This can be called multiple times! getPreferenceManager().unregisterOnActivityStopListener(this); if (mSeekBarVolumizer != null) { mSeekBarVolumizer.stop(); mSeekBarVolumizer = null; }
getPreferenceManager().unregisterOnActivityStopListener(this); if (mSeekBarVolumizer != null) { mSeekBarVolumizer.stop(); mSeekBarVolumizer = null; }
cleanup();
super.onBindDialogView(view); final SeekBar seekBar = (SeekBar) view.findViewById(com.android.internal.R.id.seekbar); mSeekBarVolumizer = new SeekBarVolumizer(getContext(), seekBar, mStreamType); getPreferenceManager().registerOnActivityStopListener(this);
super.onDialogClosed(positiveResult); if (!positiveResult && mSeekBarVolumizer != null) { mSeekBarVolumizer.revertVolume(); } cleanup();
if (mSeekBarVolumizer != null && volumizer != mSeekBarVolumizer) { mSeekBarVolumizer.stopSample(); }
mStreamType = streamType;