[
https://issues.apache.org/jira/browse/CB-9862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sergey Grebnov resolved CB-9862.
--------------------------------
Resolution: Cannot Reproduce
I've reviewed the code and also tried code snippet using the latest plugin
version from master and [email protected] / Nexus 5 Android 6.0 and I don't
see this problem. Marian, please re-open if you still see this problem
> getCurrentAcceleration not working after clearWatch
> ---------------------------------------------------
>
> Key: CB-9862
> URL: https://issues.apache.org/jira/browse/CB-9862
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Device Motion
> Affects Versions: 1.1.0
> Reporter: Marian Hello
> Labels: Android, triaged
>
> After navigator.accelerometer.clearWatch method call
> navigator.accelerometer.getCurrentAcceleration is not calling callbacks.
> How to reproduce:
> onDeviceReady: function() {
> var watchID;
> var options = { frequency: 3000 }; // Update every 3 seconds
> function onSuccess(acceleration) {
> navigator.accelerometer.getCurrentAcceleration(onCurrent,
> onError);
> navigator.accelerometer.clearWatch(watchID);
> setTimeout(start, 1000);
> }
> function onCurrent(acceleration) {
> alert('Acceleration X: ' + acceleration.x + '\n' +
> 'Acceleration Y: ' + acceleration.y + '\n' +
> 'Acceleration Z: ' + acceleration.z + '\n' +
> 'Timestamp: ' + acceleration.timestamp + '\n');
> }
> function onError() {
> alert('onError!');
> }
> function start() {
> watchID = navigator.accelerometer.watchAcceleration(onSuccess,
> onError, options);
> }
> start();
> },
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]