Closed riwnodennyk closed 8 years ago
Thanks for the feedback. It's really nice having a failing test to start working from it.
I'll check out it as soon as possible.
Take a look at the test. Now it's passing.
You need to chain the second call, as follows:
startTwoForResult.setOnClickListener(v ->
RxActivityResult.on(this)
.startIntent(new Intent(this, FirstActivity.class))
.flatMap(result -> {
result.targetUI()
.firstResult.setText(result.data().getStringExtra(FirstActivity.EXTRA));
return RxActivityResult.on(this)
.startIntent(new Intent(this, SecondActivity.class));
})
.subscribe(result -> {
result.targetUI()
.secondResult.setText(result.data().getStringExtra(SecondActivity.EXTRA));
})
);
And use result.targetUI(), don't call directly the view reference.
Failing test attached to https://github.com/VictorAlbertos/RxActivityResult/pull/14