一、Activity中
protected GestureDetector mGestureDetector;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//1.创建一个手势识别器 new 对象
mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener(){
//当手指在屏幕上滑动的时候 调用的方法.
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2,
float velocityX, float velocityY) {
if(e1.getRawX() - e2.getRawX() > 200){
//show