Android-WYSIWYG-Editor
Android-WYSIWYG-Editor copied to clipboard
imagepicker wont work with fragment
the imagepicker uses startActivityForResult from editorCore which uses the context of the view and therefor the activity. when used inside a fragment the fragment wont recieve the onActivityResult call. i added 2 methods for this :
//my addition for fragment handle
public void OpenFragmentImagePicker(Fragment fragment) {
getImageExtensions().OpenFragmentImageGallery(fragment);
}
/my extention for fragment handling
public void OpenFragmentImageGallery(Fragment fragment) {
int Index=this.editorCore.determineIndex(EditorType.none);
EditorContent state= editorCore.getContent();
Intent intent = new Intent();
// Show only images, no videos or anything else
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
// Always show the chooser (if there are multiple options available)
fragment.startActivityForResult(Intent.createChooser(intent, "Select an image"), editorCore.PICK_IMAGE_REQUEST);
}
my method is crude and this probably needs to be handled in the project
noted @abfist , will release a patch for the Fragment compatibility ASAP.
Is it patched?