I have an Activity in which I use startActivityForResult(intent,634)
. If I using it from activity, requestCode in onActivityResult()
is Ok. But if I use startActivityForResult(intent,634)
from my DialogFragment in this Activity, I'm getting another requestCode, something like 66170. So why its happens?
It happens because if you use startActivityForResult
from the dialog, in onActivityResult
you get the requestCode of the dialog. Not from your another Activity. And if you want to get right requestCode, you should use getActivity().startActivityForResult(intent,requestCode)
in DialogFragment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With