I implemented my own camera to capture image and video. I want to perform two actions on the same button.
- When the button is clicked I want to execute code for image capture.
- When I continuously press the button I want to start recording and when I release the button I want to stop recording.
Suppose I have 3 methods for above task namely captureImage(), startVideo() and stopVideo().
How to implement the above two actions on the same button? When should I call above three methods?
I tried using onClick, ACTION_DOWN and ACTION_UP, however, in this case onClick never gets called. Always ACTION_DOWN and ACTION_UP gets called.