There are api calls to activity.setRequestedOrientation(orientation)
which perform a "soft" rotate, which is not a "hardware" rotate. In other words, it is different from manually pressing Ctrl+F11/F12
to rotate the screen.
In testing of some applications, the behavior of the app could in fact differ due to this subtle difference. For example, ConnectBot
crashes when I use the api call to rotate back and forth multiple times.
My question: how can we send host key events to the host emulator process?
UPDATE: I added calls to instrumentation.waitForIdleSync();
, but it doesn't help.