0

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.

dacongy
  • 2,504
  • 3
  • 30
  • 48
  • try keeping the device in landscape mode and change Settings.System.ACCELEROMETER_ROTATION whenever you want portrait. Its a hack but might work. In some devices it changes to portrait but in some it will stay as it is. So not sure if it will work – nandeesh Aug 20 '12 at 18:58
  • @nandeesh What is `Settings.System.ACCELEROMETER_ROTATION`, and where can I change it? – dacongy Aug 20 '12 at 19:03
  • check [this](http://stackoverflow.com/questions/4908048/enable-and-disable-auto-rotate-programatically). – nandeesh Aug 20 '12 at 19:08
  • @nandeesh Now I see what you are saying, but that actually is not a problem for me. That setting is used to allow/disallow rotation. I still need a way to do real, hardware rotation, one that is exactly the same as pressing `Ctrl+F11`. – dacongy Aug 20 '12 at 21:21

0 Answers0