It's weird because it only happens on some devices (Samsung), in others it goes like a charm.
Agreed, that is weird. Throwing ideas into the mix, thinking what could be different between some phones and others:
- Variants? (although the button is there, but... could it be something in a variant chosen by the affected phones like negative width or height, or one of the button edges being outside the screen boundary). Does the button only work when you press in the area where it should be, or does pressing anywhere on the camera preview screen cause the same action? Perhaps a press on the camera preview screen defaults to taking a picture, and the button is in fact not there after all.
- Layers? Perhaps the camera panel is higher on those phones. Increase the button elevation. Make sure the button is at the bottom of the views tree ie the top layer. Add another button that you can press to disable or move the camera preview screen, to see if the button is underneath.
- Transparency somehow being set (or cleared). Reassign opaque colors to the button in code, give it a border.
- Perhaps the phone does not have the button icon or character that you are using. Try using a standard text button in its place, see if that works.
- If you add a label alongside the button, does the label show up over the camera preview screen?
- Perhaps some phones don't permit altering the camera interface, to eg thwart hackers secretly taking photos without the user knowing.
I know these all look like crazy clutching-at-straws desperation, but: weird problems call for weird ideas ;-)