Last active
April 4, 2018 14:36
-
-
Save malwinder-s/3aff3f35f44c170a3e280cddb40944d0 to your computer and use it in GitHub Desktop.
Example of Boiler plate code.
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
private fun launchStudentDetailsActivity(id: String, name: String, totalScore : Int) { | |
val intent = Intent(this, StudentDetailsActivity::class.java) | |
intent.putExtra(EXTRA_STUDENT_ID, id) | |
intent.putExtra(EXTRA_STUDENT_NAME, name) | |
//Suppose "totalScore" is score of student in 5 subjects. | |
val totalPercentage = totalScore / 5 | |
intent.putExtra(EXTRA_STUDENT_PERCENTAGE, totalPercentage) | |
startActivity(intent) | |
} | |
private fun launchStudentEditorActivity(id: String, name: String, totalScore : Int) { | |
val intent = Intent(this, StudentEditorActivity::class.java) | |
intent.putExtra(EXTRA_STUDENT_ID, id) | |
intent.putExtra(EXTRA_STUDENT_NAME, name) | |
//Suppose "totalScore" is score of student in 5 subjects. | |
val totalPercentage = totalScore / 5 | |
intent.putExtra(EXTRA_STUDENT_PERCENTAGE, totalPercentage) | |
startActivity(intent) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment