[android]代码库
import android.app.Activity;
import android.app.Service;
import android.os.Vibrator;
public class TipHelper {
public static void Vibrate (final Activity activity, long milliseconds) {
Vibrator vib = (Vibrator) activity.getSystemService (Service.VIBRATOR_SERVICE);
vib.vibrate (milliseconds);
}
public static void Vibrate (final Activity activity, long[] pattern, boolean isRepeat) {
Vibrator vib = (Vibrator) activity.getSystemService (Service.VIBRATOR_SERVICE);
vib.vibrate (pattern, isRepeat ? 1 : -1);
}
}
初级程序员
by: dodo 发表于:2013-06-25 11:35:12 顶(0) | 踩(0) 回复
Vibrator类不是写的很好吗?
这样封装,功能就少了
回复评论