jimagic / foreground-camera-plugin

Automatically exported from code.google.com/p/foreground-camera-plugin
Apache License 2.0
0 stars 0 forks source link

double clicking the shutter button is bad. #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. click on "Capture" twice
2.
3.

What is the expected output? What do you see instead?

the second click should be ignored.  instead, the application freezes.  At this 
point even uninstalling the app does not clear the problem and the builtin 
camera app is also hooped.  the only way to unbrick the device is to remove the 
battery to reboot.

What version of the product are you using? On what operating system?

this is on android on a Samsung S2

Please provide any additional information below.

The solution appears to be to add the line:
    private boolean pressed = false; //APC
to CamerActivity.java at line 26, and the lines

                if (pressed) return; //APC
                pressed = true;
 to the start of the onClick method.

Original issue reported on code.google.com by pcoate...@gmail.com on 7 Aug 2012 at 1:32

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r5.

Original comment by vinnysof...@gmail.com on 24 Sep 2012 at 8:12

GoogleCodeExporter commented 8 years ago
Thank you for reporting, pcoates42. I did some changes, please check if it 
works now.

Original comment by vinnysof...@gmail.com on 24 Sep 2012 at 8:23

GoogleCodeExporter commented 8 years ago
Instead i enabled the button as soon as i create an object of buttonview:
{
        Button captureButton = (Button) findViewById(R.id.button_capture);
        captureButton.setEnabled(true);
}
and disabled after click:
{
        public void onClick(View v) {
             captureButton.setEnabled(false);
}
This works perfect for me :)

Original comment by catchsa...@gmail.com on 31 Oct 2012 at 10:18