Skip to content

Instantly share code, notes, and snippets.

@gcherubini
Created February 1, 2021 20:50
Show Gist options
  • Save gcherubini/1ad199454d3db18530ad8ce1b837a4e8 to your computer and use it in GitHub Desktop.
Save gcherubini/1ad199454d3db18530ad8ce1b837a4e8 to your computer and use it in GitHub Desktop.
Código que adiciona um resultado ao fechamento da atividade reutilizável
companion object {
const val REUSABLE_ACTIVITY_RESULT_KEY = "reusable_activity_result_key"
}
fun setResult(screenType: ReusableScreenType, inputtedText: String?) {
val resultIntent = Intent().apply {
putExtra(
REUSABLE_ACTIVITY_RESULT_KEY, ReusableResultExtra(
inputtedText,
screenType
)
)
}
activity.setResult(Activity.RESULT_OK, resultIntent)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment