PetarMarijanovic / RxActivityResult

Rx wrapper around Androids OnActivityResult
24 stars 8 forks source link

Listener is not called after proccess death #2

Open evant opened 7 years ago

evant commented 7 years ago

Steps to reproduce:

  1. Set Developer Options -> Background Process Limit -> No background processes
  2. Open up sample app and click "Other Activity"
  3. Use the task switcher to switch to another app, killing the process of the sample app. This simulates a low-memory condition.
  4. Switch back to the sample app and click "OK"

Expected Result: Status: Ok Actual Result: No status is reported

The rx subscription is destroyed on process death and there is no code to re-attach it when the process is recreated as it's only set up in the click listener. Furthermore, the implementation uses a PublishSubject which will drop the delivered result on the floor as there is no listeners attached when resuming.

PetarMarijanovic commented 7 years ago

Thanks for the report and you are right :) I will try to fix this in the next release

Alex-Cin commented 6 years ago

https://github.com/NateWickstrom/RxActivityResult/issues/2 我也遇到这个问题了,看来 onActivityResult存在不无价值的。