use of android.os.Vibrator in project smartmodule by carozhu.
the class BeepManager method playBeepSoundAndVibrate.
/**
* 根据配置播放提示音和震动
*/
public synchronized void playBeepSoundAndVibrate() {
if (playBeep && mediaPlayer != null) {
mediaPlayer.start();
}
if (vibrate) {
Vibrator vibrator = (Vibrator) activity.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(VIBRATE_DURATION);
}
}
use of android.os.Vibrator in project coursera-android by aporter.
the class Receiver1 method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "INTENT RECEIVED");
Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(500);
Toast.makeText(context, "INTENT RECEIVED by Receiver1", Toast.LENGTH_LONG).show();
}
use of android.os.Vibrator in project coursera-android by aporter.
the class Receiver2 method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "INTENT RECEIVED");
Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(500);
Toast.makeText(context, "INTENT RECEIVED by Receiver2", Toast.LENGTH_LONG).show();
}
use of android.os.Vibrator in project coursera-android by aporter.
the class Receiver3 method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "INTENT RECEIVED");
Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(500);
Toast.makeText(context, "INTENT RECEIVED by Receiver3", Toast.LENGTH_LONG).show();
}
use of android.os.Vibrator in project coursera-android by aporter.
the class Receiver2 method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "INTENT RECEIVED");
Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(500);
Toast.makeText(context, "INTENT RECEIVED by Receiver2", Toast.LENGTH_LONG).show();
}
Aggregations