I want to do the following but in Rx. The startActivity(intent)
is guaranteed to be called since finish()
is just an async call queued:
private fun launchNewActivity(){
...
finish()
startActivity(intent)
}
So in Rx way, I'm doing something like this, where both are packaged in their own observables (requirement):
private fun launchNewActivity(): Observable<Any>{
...
return Observable.concat(
Observable.just(finish())
Observable.just(startActivity(intent))
...
)
}
However, I'm worried in the Rx way, the activity could finish before startActivity is called. Would that happen?
finish()
first has an advantage. – Loughlinfinish()
and provided with the observable? – GlaydsglazefinishActivityAction()
, which calls finish() and returns an object "RoutingResult". – Loughlin