Rotate device through data table

The orientation option is a constant, set between two predefined constants that are not strings. To allow to rotate a device (portrait/landscape) through the data table, do the following:

  1. Set the strings in the data table.

  2. Use a string compare for the string with "Portrait".

  3. Use a condition:

    • Success: Rotate device to portrait

    • Failure: Rotate device to landscape

Attached are the script and the data table that you can import and use:

RepositoryExport.mcr

Copy
<?xml version="1.0" encoding="UTF-8"?>
<table>
        <headers>
            <column>rotationState</column>
        </headers>
    <data>
        <row>
            <cell>Portrait</cell>
        </row>
        <row>
            <cell>Landscape</cell>
        </row>
    </data>
</table>