Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. ToggleButton toggle = (ToggleButton) findViewById(R.id.togglebutton1);
  2. toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  3. public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
  4. TextView text=(TextView)findViewById(R.id.textview_togglebutton);
  5. if (isChecked) {
  6. text.setText("Jestem wlaczony");
  7. } else {
  8. text.setText("Jestem wylaczony");}
  9. }
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement