1、得到系统的振动器Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);2、设置振动时间vibrator.vibrate(500);
// vibrator.vibrate(1000);// long[] pattern = new long[]{300,500,700,900};//pattern 震动变化的时间段//repeat 从pattern的哪个数组下标开始震动// vibrator.vibrate(pattern, 2);
et_number = (EditText) findViewById(R.id.et_number)Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake)et_number.startAnimation(shake);
原文:http://www.cnblogs.com/candledragle/p/4243041.html