Android Code Snippet Set any activity orientation (opposite to #SupportedOrientations)

Discussion in 'Code Snippets' started by Peter Simpson, Sep 20, 2018.

  1. Peter Simpson

    Peter Simpson Expert Licensed User

    SubName: Set any activity to the opposite orientation used in the app.
    Description: Using this line of code in your manifest allows you to set one (or more) of your projects activities to a different orientation than the default one which is set in the Main activity using #SupportedOrientations.
    Code:
    'Set activity to Landscape
    SetActivityAttribute(<ActivityName>,
        android:screenOrientation,
        
    "landscape"
    )
    Tags: Rotate, Orientation, Activities, Manifest

    Please note: I couldn't find this on the forum anywhere, so if it's already on here then I missed it.

    Enjoy...
     
    Last edited: Sep 20, 2018
  2. Serge Bertet

    Serge Bertet Member Licensed User

    ScreenOrientation possible values: unspecified, landscape, sensorLandscape, sensorPortrait or portrait.
     
    Last edited: Dec 8, 2018
    Peter Simpson likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice