Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aporter committed Aug 20, 2014
1 parent f4678a0 commit 26a516a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// Get a reference to a background container
final LinearLayout bg = (LinearLayout) findViewById(R.id.linearlayout);

// Get a reference to the ToggleButton
final ToggleButton button = (ToggleButton) findViewById(R.id.togglebutton);

// Set an OnClickListener on the ToggleButton
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {

// Toggle the Background color between a light and dark color
if (button.isChecked()) {
bg.setBackgroundColor(0xFFF3F3F3);
} else {
Expand Down

0 comments on commit 26a516a

Please sign in to comment.