joaquim-verges/Helium

Fragment onActivityResult pushState failed to change ViewDelegate state

Closed this issue · 1 comments

fragment.onActivityResult(...) {
  if (resultCode == Activity.RESULT_OK) {
    presenter.pushState(FragmentViewState.LoadResult(result))
 }
}
 

Thanks for pointing this out, this actually reveals an issue with Fragments starting activities in general.

The solution is to call attach() in onStart instead of onCreateView, this should solve your issue.

I'll update the sample code and docs to reflect this.

Thanks again!