cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Grebnov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-9862) getCurrentAcceleration not working after clearWatch
Date Thu, 21 Jan 2016 08:43:39 GMT

     [ https://issues.apache.org/jira/browse/CB-9862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Grebnov updated CB-9862:
-------------------------------
    Labels: Android triaged  (was: Android)

> 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message