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. More Button in Expanded Menu

May someone please tell me how to change the text "More" of "More
Button" in an expanded menu to other strings?

-- 

2. Whats the current View?

Im sure a dumb question, but how do I get the current view?

I have implemented an expandedList from a sample, but it does not use
an .xml file to define the view. It works, but now Im trying to add a
context menu for a long press.  I need to pass the current view into
the registerForContextMenu(view)   method.

Some of the code ...

public class HomePage  extends ExpandableListActivity {
    private ExpandableListAdapter mAdapter;
...  load some data to arrays ....
    mAdapter = new SimpleExpandableListAdapter(     ....

    setListAdapter(mAdapter);
.....

Since there was no xml,  there was no  R.layout.xxxxx.

-- 

3. Twitter + contacts integration - what apis are used ?

4. Webinar: Eclipse IDE for Java EE: Automate Problem Resolution (Replay Solutions, Inc.) - Wed, May 12, 11:00 AM pacific

5. DDMS Event LogParser error codes

6. Ajax in Webview

7. Twitter + contacts integration - what apis are used ?