Skip to content

Instantly share code, notes, and snippets.

@surajsau
Last active February 5, 2020 10:11
Show Gist options
  • Save surajsau/7904bc1c052576dd8ba7f96bf537bfc1 to your computer and use it in GitHub Desktop.
Save surajsau/7904bc1c052576dd8ba7f96bf537bfc1 to your computer and use it in GitHub Desktop.
Flow 1: Partial flow in MCQ
class A: AppCompatActivity() {
..
fun startB() {
..
startActivityForResult(intent, REQ_CODE)
}
override onActivityResult(intent, reqCode, ..) {
if(reqCode == REQ_CODE) {
when(intent.getString("source")) {
"B" -> btn.text = "Continute"
..
}
}
}
}
class B: AppCompatActivity() {
..
fun clickBack() {
..
intent.put("source", "B")
setResult(RESULT_OK, intent)
finish()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment