Created
August 3, 2014 22:41
-
-
Save ckashby/78fb434fed7cd78953ab to your computer and use it in GitHub Desktop.
Android Switch / Case ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override // this does not override a super class method. Whats up? | |
public void onClick(View view) { | |
switch (view.getId()) { | |
case R.id.taskButton: { | |
Intent intent = new Intent(this, TasksActivity.class); | |
startActivity(intent); | |
} | |
break; | |
case R.id.phoneButton: { | |
Intent intent = new Intent(this, PhoneActivity.class); | |
startActivity(intent); | |
} | |
break; | |
case R.id.musicButton: { | |
Intent intent = new Intent(this, MusicActivity.class); | |
startActivity(intent); | |
} | |
break; | |
case R.id.calendarButton: { | |
Intent intent = new Intent(this, CalendarActivity.class); | |
startActivity(intent); | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment