Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PickupDeviceListener.onDevicePutDown() is never called #47

Open
FormallyMyles opened this issue Apr 10, 2019 · 0 comments
Open

PickupDeviceListener.onDevicePutDown() is never called #47

FormallyMyles opened this issue Apr 10, 2019 · 0 comments

Comments

@FormallyMyles
Copy link

Do you want to request a feature or report a bug?
Bug Report

What is the current behaviour?
The PickupDeviceListener.onDevicePutDown() method is never called so any code using it is never triggered.

If the current behaviour is a bug, please provide the steps to reproduce.
Put down the phone, the event is not called (if you put System.out.println() statements)

What is the expected behavior?
The method should be called when the phone is placed down (I'm not entirely sure on the exact parameters to detect this).

Relevant Code

Interface:

Should be called somewhere around here:

protected void onSensorEvent(SensorEvent sensorEvent) {
float x = sensorEvent.values[0];
float y = sensorEvent.values[1];
float z = sensorEvent.values[2];
double vectorSum = Math.sqrt(x * x + y * y + z * z);
if (vectorSum > 11) {
pickupDeviceListener.onDevicePickedUp();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant