Source:
<code>protected void initListeners() { super.initListeners(); infoItemBuilder.setOnStreamSelectedListener(new OnClickGesture<StreamInfoItem>() { @Override public void selected(StreamInfoItem selectedItem) { selectAndLoadVideo(selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName()); } @Override public void held(StreamInfoItem selectedItem) { showStreamDialog(selectedItem); } }); videoTitleRoot.setOnClickListener(this); uploaderRootLayout.setOnClickListener(this); thumbnailBackgroundButton.setOnClickListener(this); detailControlsBackground.setOnClickListener(this); detailControlsPopup.setOnClickListener(this); detailControlsAddToPlaylist.setOnClickListener(this); detailControlsDownload.setOnClickListener(this); detailControlsDownload.setOnLongClickListener(this); relatedStreamExpandButton.setOnClickListener(this); switchAutoplay.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { SharedPreferences autoplaysetting = PreferenceManager.getDefaultSharedPreferences(activity); <START> if(switchAutoplay.isChecked()){ <END> autoplaysetting.edit().putBoolean(getString(R.string.auto_queue_key),true).apply(); }else{ autoplaysetting.edit().putBoolean(getString(R.string.auto_queue_key),false).apply(); } } }); detailControlsBackground.setLongClickable(true); detailControlsPopup.setLongClickable(true); detailControlsBackground.setOnLongClickListener(this); detailControlsPopup.setOnLongClickListener(this); detailControlsBackground.setOnTouchListener(getOnControlsTouchListener()); detailControlsPopup.setOnTouchListener(getOnControlsTouchListener()); }</code><technical_language>simple PreferenceManager.getDefaultSharedPreferences(activity).edit() .putBoolean(getString(R.string.auto_queue_key),switchAutoplay.isChecked()) .apply();</technical_language>

Target:
protected void initListeners() { super.initListeners(); infoItemBuilder.setOnStreamSelectedListener(new OnClickGesture<StreamInfoItem>() { @Override public void selected(StreamInfoItem selectedItem) { selectAndLoadVideo(selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName()); } @Override public void held(StreamInfoItem selectedItem) { showStreamDialog(selectedItem); } }); videoTitleRoot.setOnClickListener(this); uploaderRootLayout.setOnClickListener(this); thumbnailBackgroundButton.setOnClickListener(this); detailControlsBackground.setOnClickListener(this); detailControlsPopup.setOnClickListener(this); detailControlsAddToPlaylist.setOnClickListener(this); detailControlsDownload.setOnClickListener(this); detailControlsDownload.setOnLongClickListener(this); relatedStreamExpandButton.setOnClickListener(this); switchAutoplay.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { PreferenceManager.getDefaultSharedPreferences(activity).edit() .putBoolean(getString(R.string.auto_queue_key),switchAutoplay.isChecked()) .apply(); } }); detailControlsBackground.setLongClickable(true); detailControlsPopup.setLongClickable(true); detailControlsBackground.setOnLongClickListener(this); detailControlsPopup.setOnLongClickListener(this); detailControlsBackground.setOnTouchListener(getOnControlsTouchListener()); detailControlsPopup.setOnTouchListener(getOnControlsTouchListener()); }