Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple call needs tag/requestCode #3

Closed
NewITCorp opened this issue May 13, 2018 · 4 comments
Closed

multiple call needs tag/requestCode #3

NewITCorp opened this issue May 13, 2018 · 4 comments
Labels
Milestone

Comments

@NewITCorp
Copy link

Hi again,
lets say I have more than one imagepickers in an activity, I implement OnSingleImageSelectedListener interface in that activity.
now at onSingleImageSelected(Uri uri), I cannot distinguish who is the caller.
Maybe I request to have some requestCode or Tag attached to the method, or any other idea?.

int requestCode1 = 1, requestCode2 = 2;
//caller1
singleSelectionPicker.show(1, getFragmentManager(), "picker");
//caller2
singleSelectionPicker.show(2, getFragmentManager(), "picker");

onSingleImageSelected(int requestCode, Uri uri){
if (requestCode == 1)...
else ...
}

thanks in advance,

@siralam
Copy link
Owner

siralam commented May 13, 2018

Yes, I have the same consideration when I found that I have to let the caller Activity or Fragment implements the listener.

What I would suggest is handling the request code by yourself.
Since it is impossible to launch 2 pickers at the same time, you can create a requestCode variable by yourself, can change its value the moment you show the picker (e.g. in some OnClickListener.onClick()).

But a request code is also a good idea. I would include it into the next release.

Thanks!

@siralam siralam added the enhancement New feature or request label May 13, 2018
@NewITCorp
Copy link
Author

Ok, I will handle it myself until then.

@siralam
Copy link
Owner

siralam commented Oct 24, 2018

Thanks to @ikakus this will be added in the next version.

@siralam siralam added this to the 1.1.0 milestone Oct 24, 2018
@siralam
Copy link
Owner

siralam commented Nov 27, 2018

Implemented in 1.1.0

@siralam siralam closed this as completed Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants