1. Download our Official Android App: Forums for Android!

Rotation Lock

Discussion in 'Android Lounge' started by N0dGrand87, Jul 30, 2010.

  1. N0dGrand87

    N0dGrand87 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jul 30, 2010

    Jul 30, 2010
    3
    0
    5
    Hello All. In my version of firmware (kernel 2.6.32.9) I have button "Orientation Lock" in status bar buttons (at Wi-Fi, Bluetooth, GPS and Silent buttons).

    Does any body know how to create the same function in my application with Android SDK???

    I need to lock my screen in any of four orientations: Portrait, Landscape, Portrait bottom, and Landscape Right.

    setRequestOrientation does only one of two lock: Portrait or Landcsape.

    Thanks...
     

    Advertisement

  2. cmh0114

    cmh0114 Well-Known Member
    Rank:
    None
    Points:
    36
    Posts:
    114
    Joined:
    Jan 10, 2010

    Jan 10, 2010
    114
    7
    36
    What are Portrait bottom and Landscape right? I've only ever used Portrait and Landscape - what else can there be?
     
  3. N0dGrand87

    N0dGrand87 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jul 30, 2010

    Jul 30, 2010
    3
    0
    5
    If you LOCK your activity with setRequestedOrientation in landscape mode, and then rotate it from portrait mode to landscape mode by clockwise - you can see that screen will be rotated on 180 degrees.

    How can I lock the activity in that position, and screen should be rotated correctly - not rotated.

    I need to lock screen in all 4 position. API allows do it only in two.

    Thanks.

    Sorry for my bad english.
     
  4. cp1

    cp1 Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    375
    Joined:
    Apr 30, 2010

    Apr 30, 2010
    375
    35
    53
    If you use the monkey with the emulator it will get your app into all sorts of odd orientations, it sounds like these are some of those.
     
  5. N0dGrand87

    N0dGrand87 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jul 30, 2010

    Jul 30, 2010
    3
    0
    5
    That is! But how does this program do those things????

    Is there some standard Android API for screen rotation in all four positions??
    This is the question)
     
  6. cp1

    cp1 Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    375
    Joined:
    Apr 30, 2010

    Apr 30, 2010
    375
    35
    53
    I have no idea -- I have the opposite problem, I wish it would stop flipping it into those orientations!

    It writes:

    "Sending Flip keyboardOpen=false"
    "Sending Flip keyboardOpen=true"

    but doesn't give any more info
     
  7. GatorDude

    GatorDude Lurker
    Rank:
    None
    Points:
    25
    Posts:
    5
    Joined:
    Aug 24, 2010

    Aug 24, 2010
    5
    0
    25
    Orientation locking is going to become more important as non-phones come into the market. I have a non-phone netbook running Android 1.6. It's the Augen GenBook 74. When apps re-orient the screen from landscape to portrait, the controls get pretty screwed up. It would be nice to be able to lock the device into one orientation and control set up. As a user, it would be nice to be able to reset the orientation back to normal without having to reboot the device.
     
  8. isitafox

    isitafox Newbie
    Rank:
    None
    Points:
    15
    Posts:
    14
    Joined:
    Jan 26, 2011

    Jan 26, 2011
    14
    0
    15
    Bit of a bump this but I'm after a similar program. I've got a Dell streak which I like to use in portrait but the only way to do this is turning off the screen lock but that means it's permanantly swapping orientation, and I've tried a few lock programs but all they do is activate the standard screen lock leaving it stuck in landscape.
    HELP!!
     

Share This Page

Loading...