android-image-picker
android-image-picker copied to clipboard
Use case Java sample for 3.0.0-beta1
First thanks to the great work done on this ImagePicker.
As I do not know Kotlin at all, I have some difficulties to used your 3.0.0beta1.
Are you able to provide me with a sample in Java (particularly on the result callback)?
I have successfully used this Java code to instantiate ImagePicker in, Java in 3.0.0-beta1.
launcherSessionImage = ImagePickerLauncherKt.registerImagePicker(
EditSessionFragment.this,
(List<Image> images) -> {
for(Image image : images)
{
// Actions
}
return null;
});
But, if I try to migrate to 3.0.0-beta4, it not works (ERROR : Cannot resolve method 'registerImagePicker(fr.piscarius.piscarius.fragment.EditSessionFragment,
@prosperz31 did you got it working for 3.0.0-beta4 ?
Unfortunately I found another library in final version allowing to use this.
I decided to stop using esafirm even if it stays a great ImagePicker ! It is just a personal choice.
Just to clearly answer to your question : I never get this working in beta4 ;)
I figured it out
ImagePickerLauncher launcher = ImagePickerLauncherKt.registerImagePicker(this, ()->{return this;}, (List<Image> images) -> {
for(Image image : images)
{
// Actions
Log.e("IMG", String.valueOf(image));
}
return null;
});
I do not have any environment to check this. But it could be a good way.
@jerinamathews I am trying to make it work with Java code, using stable version 3.0.0.
Tested the code snippet you shared, but it din't work !
Edit
Managed to make it work by replacing "()->{return this;}" with "()-> {return getContext();}", Iam executing the ImagePicker launcher from a Fragment.