I\'m writing some acceptance tests for an application using the ActivityInstrumentationTestCase2 class. I want to cause an orientation change from within the test to ensure
Use Robotium for it. There is a class called Solo, using which you can change orientation by just calling a method:
solo.setActivityOrientation(Solo.LANDSCAPE);
That's it! Your orientation would get changed. You can google Robotium and obtain its jar and add it to your Test project. The Robotium site also gives an example Test project on Android's Notepad App (which is available as a sample project with Android SDK) which shows how powerful it is and how easily it could be used.