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.
****************************************************
if(android.provider.Settings.System.getInt(getContentResolver
(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1) {
android.provider.Settings.System.putInt(getContentResolver
(),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

Hello

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

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

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
background.

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
foreground?

regards,
Radu


--~--~---------~--~----~------------~-------~--~----~

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