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

Wrong image selection with camera #49

Open
xPryds opened this issue Feb 26, 2019 · 2 comments
Open

Wrong image selection with camera #49

xPryds opened this issue Feb 26, 2019 · 2 comments

Comments

@xPryds
Copy link

xPryds commented Feb 26, 2019

When choose use camera and take photo, it is showing 2 selected images.
After, If I open an image preview and then close it, It will add +1.
It will keep adding +1 even if I don't check the image preview.

Clicking in DONE btn send me back to previous activity with N times the camera image.

@hututu-AE86
Copy link

I also had this problem with android 7.0. I don't have duplicate selection problems when I use debug breakpoints, so I think it has something to do with that broadcast.
Can you talk about your solution?

@sqbfine
Copy link

sqbfine commented May 29, 2019

I have the same question with SAMSUNG s7 & SAMSUNG s 8.
I solved it this way.
In ImagePickActivity :

private boolean findAndAddTakenImage(List<ImageFile> list) {
    for (ImageFile imageFile : list) {
        if (imageFile.getPath().equals(mAdapter.mImagePath)) {
            boolean contains = mSelectedList.contains(imageFile);
            if (contains) {
                return true;
            }
            mSelectedList.add(imageFile);
            mCurrentNumber++;
            mAdapter.setCurrentNumber(mCurrentNumber);
            tv_count.setText(mCurrentNumber + "/" + mMaxNumber);

            return true;   // taken image was found and added
        }
    }
    return false;    // taken image wasn't found
}

vito-kong pushed a commit to vito-kong/MultiType-FilePicker that referenced this issue Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants