SensorCore with CameraCaptureTask

87 Views Asked by At

In our WP 8.1 application, we're using the SensorCore SDK to collect some information about movements of the user, and we use the CameraCaptureTask too. When we launch the task with CameraCaptureTask.Show(), the application crashes, sometimes before the capture, sometimes after, and sometimes after the event Completed, and with this message in VS 2013 : 'The program '[2512] AgHost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.' However, the capabilities are activated, and the exact same piece of code work without the SensorCore activated. We use a Lumia 635.

Any ideas ?​

1

There are 1 best solutions below

1
On BEST ANSWER

Are you deactivating SensorCore related stuff before navigating away/showing task? You need to do that, otherwise the app crashes.

Read the SensorCore essential practices. There are code samples for both Silverlight and WinRT on how to deactivate sensors.

For example:

protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e) 
{
    await _stepCounter.DeactivateAsync(); 
}