Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 19.0Version 18.0 (current version)

Index

On this page

You are viewing an incomplete pre-release version of this documentation. Click here to open the current version, 18.0.

KMManager.getOrientation()


Summary

The getOrientation() method returns the current orientation of the device.

Syntax

KMManager.getOrientation(Context context)

Parameters

context
The context.

Returns

Returns the device orientation as an int, one of:

  • Configuration.ORIENTATION_PORTRAIT (1)
  • Configuration.ORIENTATION_LANDSCAPE (2)
  • Configuration.ORIENTATION_UNDEFINED (0)

Description

Use this method to get the current orientation of the device

Examples

Example: Using getOrientation()

The following code illustrates the use of getOrientation():

    int orientation = KMManager.getOrientation(context);