BlackBerry Unable to close camera using EventInjector for touch screen

Source: Internet
Author: User

Http://supportforums.blackberry.com/t5/Java-Development/Unable-to-close-camera-using-EventInjector-for-touch-screen/m-p/785247#M143879

 

So I believe I have found a way to make this work consistently. My
Issue was not the permissions, as all along I was testing with
Proper permissions set (or by prompting hte user to set them).
Solution I found is to put a Thread. sleep (500) between the two injected
ESCAPE events as follows:

 

 

EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0);
inject.post();
sleep(500);
inject.post();





I'm
Not exactly sure why this works, and I'm not saying that it's the right
Way to solve the problem, but it works for me. I tried shorter sleep
Times but 500 ms was the shortest that I cocould get to consistently work.
Also, this didn't work when I used the EventInjector. invokeEvent ()
Method, only with the post () method. Hope this helps some people out.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.