I have an application and I have a third party sdk which is a transaction app, I want to get back to my result fragment if the result is successful. If it’s cancelled or not successful, I want to get back to the first fragement. how can I do that?
fun initView() {
binding.apply {
button.setOnClickListener {
findNavController().navigate(R.id.action_to_price_Enter_Fragment)
}
val args = arguments
val amount = args?.getString("amount")
val trace = args?.getString("trace")
val rrn = args?.getString("rrn")
val status = args?.getString("status")
val statusText = if (status == "00") "success" else "fail"
tvResult.text = "transaction : $statusText"
tvPrice.text = "$amount rial"
tvTrackingCode.text = trace
}
}
New contributor
Fatemeh Sarikhani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.