I want to run a hello world sample application only in landscape mode on my device. if the device changed to portrait, i would then like to raise one toaster. for example "please change to landscape mode to run your application".. In order to run your app always in portrait mode even when orientation may be or is swapped etc (for example on tablets) i designed this function that is used to set the device in the right orientation without the need to know how the portrait and landscape features are organised on the device.. If you are targetting android sdk 9 or above, you can use sensorlandscape instead of landscape which will mean that the screen will look the correct way up on both normal landscape orientation and reverse landscape orientation..
In this video you will learn about orientation modes in android.this can be landscape or portrait.when you rotate the device it changes the orientation of app,so if you want only a portrait or. Android mobile devices can be held in portrait or landscape mode. a program can chose to operate in one or both of those modes. this programming article describes how an android app can support both portrait and landscape orientation with the same code. only the resource files differ..
No comments:
Post a Comment