Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ToggleButton toggle = (ToggleButton) findViewById(R.id.togglebutton1);
- toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- TextView text=(TextView)findViewById(R.id.textview_togglebutton);
- if (isChecked) {
- text.setText("Jestem wlaczony");
- } else {
- text.setText("Jestem wylaczony");}
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement