Code example for ToggleButton

Methods: isChecked

0
        if (!(v instanceof ToggleButton)) {
            Log.e("SampleToggleListener", "Invalid View type: " + v.getClass());
            return; 
        } 
        ToggleButton currentButton = (ToggleButton) v;
        if (currentButton.isChecked())
            sequencer.enableCell(samplerId, beatId);
        else 
            sequencer.disableCell(samplerId, beatId);
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java