android - Protect View from continuous touch events -


I'm building a camera app like Bell, where you record the video while holding your finger on the screen

My problem: If a person has a fast and continuous tube on the screen, then camera logic gets many events. It continually tries to write files, close the recorder, open a new connection, and so on.

The camera looks very fragile when it has to start and stop recording in a very short time frame.

I tried to set a flag which prevents new speed events from reaching the camera, while it is still busy on the previous operation. It is ugly but it works. The main problem is that, Motion events arise and rise after each other due to each other.

I have speed events ACTION_UP and ACTION_DOWN to find out if the user has placed a finger on the screen or released it.

Is there any good way to disable the dynamic events during the camera preparation and release process?

Try this:

  // class variable timer timer; Public Boolean On-Touch (see View, Motion Event Event) {// Change Event Type Switch (event.getAction ()) {// Finger Down Case MotionEvent.ACTION_DOWN: Timer = New Timer (); Timer.schedule (recordingfunc (), 1000); break; Case Motion Event Action_up: if (timer! = Null) {timer.cancel (); }                       break; }}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -