如何在扩展RecyclerView.Adapter的类中重新绑定视图

我想在closeDialog()调用时重新绑定视图。我认为我应该以某种方式将视图标记为肮脏的。如果这是采取的正确措施,我将如何做?我的代码:


public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolder>

        implements DialogInterface.OnClickListener, SeekBar.OnSeekBarChangeListener

{

    private SettingsFragmentView mView;

    private Context mContext;

    private ArrayList<SettingsItem> mSettings;


    private SettingsItem mClickedItem;

    private int mSeekbarProgress;


    private AlertDialog mDialog;

    private TextView mTextSliderValue;


    public SettingsAdapter(SettingsFragmentView view, Context context)

    {

        mView = view;

        mContext = context;

    }

  

  // Unrelated code removed here

  

    @Override

    public void onClick(DialogInterface dialog, int which)

    {

        if (mClickedItem instanceof SingleChoiceSetting)

        {

            SingleChoiceSetting scSetting = (SingleChoiceSetting) mClickedItem;


            int value = getValueForSingleChoiceSelection(scSetting, which);

            MenuTag menuTag = scSetting.getMenuTag();

            if(menuTag != null)

            {

                if (menuTag.isGCPadMenu())

                {

                    mView.onGcPadSettingChanged(menuTag, value);

                }


UYOU
浏览 200回答 1
1回答

慕后森

notifyDataSetChanged()&nbsp;似乎解决了这个问题。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java