SolvedAndroid Image Cropper Usage In Fragment

I can`t able to use this in fragment

18 Answers

✔️Accepted Answer

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.

Other Answers:

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".

More Issues: