Can i specially forbids switching orientation when rotating phone on my app?

by Philip » Sat, 24 Oct 2009 17:23:01 GMT

Sponsored Links
 When i chick a button on my app , the method below will be happened.
(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1) {
(),Settings.System.ACCELEROMETER_ROTATION, 0);
Here i want to forbids switching orientation when rotating phone.
Also i hope the screen orientation will not be changed.
But when here is horizontal screen mode, the screen orientation will
be changed to vertical mode automatically .
That's not what i want.
Any suggestions?


Other Threads

1. Question about transparent views


I am using a view with a transparent background for activity A:

    <style name="Theme.Transparent">
        <item name="android:windowBackground">@drawable/
        <item name="android:windowNoTitle">true</item>

The problem i am having trouble solving is:

I start activity A from the home screen. Activity A then launches
activity B, using startActivity() (it's not a sub-activity). Once i
finish using activity B, i return to activity A, but since the home
screen has probably been paused and is no longer visible, i see the
white and gray check board pattern behind activity A's transparent

How can i find out what activity is behind Activity A so that i can
resume it? How can i resume it while keeping Activity A in the



2. Problem with displaying Notification

Hi ,
  I have a problem with notification manager. My notification is
defined in an activity. Hence everytime a notification comes, my
activity is displayed on the screen and then the notification pops up
in the status bar. However, This does not appear good as the user
might be doing something already on the screen and my activity should
not over ride the screen which was being displayed.
I want my notification in the status bar to be displayed without the
activity being overridden. Any suggestions?

3. TabActivity example?

4. invoke an action in an already running activity

5. Blank screen after Activity starts

6. How to show one View inside another.

7. Capturing the incoming phone number when recieving a call