I have a file CartActivity.kt from which I make an external API call. If the API call is successful it launches an activity called CurrentOrders.
val currentOrdersIntent = Intent(this@CartActivity, CurrentOrdersActivity::class.java)
currentOrdersIntent.putExtra("orderListObj",orderListObj)
currentOrdersIntent.flags = Intent.FLAG_ACTIVITY_NO_ANIMATION
Toast.makeText(this@CartActivity,"${response.body()?.message}",Toast.LENGTH_SHORT).show()
startActivity(currentOrdersIntent)
finish()
My CurrentActivity code contains a recyclerview and a button that makes a call to external API.
My problem is that once I reach currentOrders from cartactivity I have to press back button 4-5 times before it reaches the activity that started the cartactivity.
Ideally what I want if Activity A starts cartactivity which in turn starts currentactivity, so after I press back from current activity it should route me to activity A.
Here is the link to CartActivity. Link to CurrentActivity.
This is the link for Complete-project.