This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorManager; | |
public class ShakeListener implements SensorEventListener { | |
//速度阈值,当摇晃速度达到这值后产生作用 | |
private static final int SPEED_SHRESHOLD = 2500; |