Usage In FragmentSee original GitHub issue
I can`t able to use this in fragment
- Created 7 years ago
- Comments:17 (5 by maintainers)
Top GitHub Comments
you started the activity using
.start(getActivity()); this way the result will only return in the activity, not in the fragment.
If you use appcompat fragment (recomended) you can call
.start(getContext(), this) otherwise you need to call
.getIntent(getContext()) and then use this intent to start the activity from your fragment.
from my tests it looks like everything works.
Just to be sure you are not missing something. you should override the
onActivityResult of the fragment to receive the result and if you did override
onActivityResult the result there will be received with different request code, so you must call
super.onActivityResult(requestCode, resultCode, data); to pass the result to the fragment.
If this doesn’t answer you issue please provide more data than “not working”.