Android's ToggleButton setChecked(…) method not changing status of button

前端 未结 4 389
囚心锁ツ
囚心锁ツ 2021-01-07 02:09

I have a togglebutton which is not responding to my setChecked(...) method. Here is the code:

mBool = mPrefs.getBoolean(\"buttondefault\", true);
Boolean b =         


        
4条回答
  •  攒了一身酷
    2021-01-07 02:52

    Please use primitive boolean to set the state

    //set true or false based on your prefs
    boolean mBool = true;
    mToggle.setChecked(mBool);
    

提交回复
热议问题