Created
February 1, 2021 20:50
-
-
Save gcherubini/1ad199454d3db18530ad8ce1b837a4e8 to your computer and use it in GitHub Desktop.
Código que adiciona um resultado ao fechamento da atividade reutilizável
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
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