@Override
public void startOrientationListener() {
if (orientationEventListener != null) {
callback.receive(lastOrientation);
return;
}
new OrientationEventListener() //this line should be remove it doesn't make sense
orientationEventListener = new OrientationEventListener(context, rate.nativeValue) {
@Override
public void onOrientationChanged(int angle) {
NativeOrientation newOrientation = calculateSensorOrientation(angle);
if (!newOrientation.equals(lastOrientation)) {
lastOrientation = newOrientation;
callback.receive(newOrientation);
}
}
};
if (orientationEventListener.canDetectOrientation()) {
orientationEventListener.enable();
}
}
A line should be remove it doesn't make sense