Reputation: 141
At the time of button click I need to show my data in landscape view.
How to show the data in landscape view?
Upvotes: 0
Views: 365
Reputation: 26545
Add the following line in the onClick event of the button.
yourActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
The constants that should be used are defined in the ActivityInfo class.
Upvotes: 3
Reputation: 3924
The simplest method would be to use a separate Activity to display the data and in your manifest add the following attribute to the activities declaration;
android:screenOrientation="landscape"
You can find more information on that setting at http://developer.android.com/guide/topics/manifest/activity-element.html
Upvotes: 0