Implementing a shake event
问题 I'm having trouble figuring out how to implement the code from this answer. Android: I want to shake it Do I need to create a method and use an if statement to find if mAccel is greater than 0? package your.shake.namespace; import android.app.Activity; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.os.Vibrator;