Class Orientation
Defined in: phonegap.js.
Constructor Attributes | Constructor Name and Description |
---|---|
This class provides access to the device orientation.
|
Field Attributes | Field Name and Description |
---|---|
The last known orientation.
|
Method Attributes | Method Name and Description |
---|---|
clearWatch(watchId)
Clears the specified orientation watch.
|
|
getCurrentOrientation(successCallback, errorCallback)
Asynchronously aquires the current orientation.
|
|
watchOrientation(successCallback, errorCallback)
Asynchronously aquires the orientation repeatedly at a given interval.
|
Field Detail
lastOrientation
The last known orientation.
Method Detail
clearWatch(watchId)
Clears the specified orientation watch.
- Parameters:
- {String} watchId
- The ID of the watch returned from #watchOrientation.
getCurrentOrientation(successCallback, errorCallback)
Asynchronously aquires the current orientation.
- Parameters:
- {Function} successCallback
- The function to call when the orientation is known.
- {Function} errorCallback
- The function to call when there is an error getting the orientation.
watchOrientation(successCallback, errorCallback)
Asynchronously aquires the orientation repeatedly at a given interval.
- Parameters:
- {Function} successCallback
- The function to call each time the orientation data is available.
- {Function} errorCallback
- The function to call when there is an error getting the orientation data.