Rotational Forces, Part Four
Today, though, we’ll take a look at a radical alternative: tell Android not to rotate your activity at all. If the activity does not rotate, you do not have to worry about writing code to deal with rotations.
To block Android from rotating your activity, all you need to do is add android:screenOrientation=”portrait” (or “landscape”, as you prefer) to your AndroidManifest.xml file, as shown below:
Since this is applied on a per-activity basis, you will need to decide which of your activities may need this turned on.
At this point, your activity is locked into whatever orientation you specified, regardless of what you do. The following screen shots show the activity we developed in the first three posts, using the above manifest, with the emulator set for both portrait and landscape orientation — note that the UI does not move a bit, but remains in portrait mode.
You might also like
The new G1 Google Phone turns TV today! After the successful launch of dailyme.tv (www.dailyme.tv) on their devices, users can now watch TV for free, wherever and whenever they want
Available exclusively for 30 days on Sony’s Xperia smart phones
In past, several companies have launched products which are designed especially for kids, like the MEEP. The good things about such gadgets are that they are easy to use and have