How do I use an eventinjector on a browser in blackberry to close the browser. I want to simulate the ESCAPE key being pressed on the handheld when the browser loads so that the app exits the browser and goes back to the main screen. I tried doing this myself but have not been successful. Any help would be most appreciated.
相关问题
- TestCafe - The browser always starts in clean slat
- UrlEncodeUnicode and browser navigation errors
- Character Encoding in iframes
- How to load local *.htm file to WPF WebBroswer wit
- Selenium newer Chrome cannot disable browser notif
相关文章
-
Is it bad to put elements within the <hea
- Calling Chrome web browser from the webbrowser.get
- How can a browser know the scss files?
- Is there a way to specify minimum and maximum zoom
- How to invoke phone dialer in browser? or is it im
- Can't detect Android in web server
- Android browser scaling?
- Form being randomly submitted as GET instead of PO
查看全部
Not sure why you want to close the browser, but I'll assume you know that it's the right thing to do (also, Eugen already suggested how you could use the
BrowserField
to let the user browse from within your app and avoid this issue).Anyway, I have some code that I use to close the Camera (which my app did start, intentionally). You could probably close the browser the same way. This is a hack, but at the time, it was the way I solved the problem:
My
_mainScreen
is theScreen
that should be uncovered by closing the Camera app, so I use it to test that I closed Camera successfully. Also, in my app, I resetevery time the Camera was launched (which is not shown above).
Update:
Also, this is the code my
_mainScreen
object needs to keep track of whether it's exposed or not:If you really want to control browser, you could use
BrowserField
,BrowserField2
in your app.You could also inject listener for key pressing or tracking which app is visible right now. But it will be really tricky because users are switching between apps often and there are quite many devices with touch interfaces now (user could close page without esc button).