notification通知配合使用LED灯,附带震动

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

notification通知配合使用LED灯,附带震动
notification.ledARGB = Color.BLUE;
notification.ledOffMS = 100;
notification.ledOnMS = 100;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.flags |= Notification.FLAG_AUTO_CANCEL;// 点击取消
Vibrator vibrator = (Vibrator) context
.getSystemService(Service.VIBRATOR_SERVICE);
vibrator.vibrate(new long[] { 200, 500, 200, 500 }, -1);// {200,200,1000}这样的mode表示的是等待0.2秒,振动0.5秒, 等待0.2秒,振动0.5秒,

转载于:https://my.oschina.net/dminter/blog/205018

你可能感兴趣的:(notification通知配合使用LED灯,附带震动)