Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最初にトグル ボタンの状態を false から true に変更したいのですが、true の場合はトグル ボタンを無効にして、誰も再度変更できないようにしたいと考えています。
あなたはこのようにするかもしれません、
//get the button as ToggleButton tb = (ToggleButton) findViewById(R.id.togglebutton1); // check it is enabled if(tb.isChecked()){ //do something on enabling it tb.setEnabled(false); // disable it }