florent37 / InlineActivityResult

Receive the activity result directly after the startActivityForResult with InlineActivityResult
MIT License
273 stars 28 forks source link

Intent repeatedly fired #8

Closed NickvanDyke closed 5 years ago

NickvanDyke commented 5 years ago

I'm finding that ActivityResultFragment fires its intent over and over again, presumably since it calls startActivityForResult in onResume, and it's paused and later resumed whenever an intent is fired, since that opens another app and puts ours in the background. This makes the library unusable; as soon as the called activity finishes and returns a result to my app, the intent is fired again, and the called activity opens again.

According to the docs, onActivityResult should be called before onResume, in which case the fragment should remove itself before its onResume is called, but that's not what I'm experiencing on Android 7.0 and 9.0.

I don't think it's related, but I'm using the coroutines version.

NickvanDyke commented 5 years ago

Disregard, my Activity was extending from a library's Activity that doesn't call super.onActivityResult(), so the ActivityResultFragment wasn't receiving its result