当前位置: 代码迷 >> 移动开发 >> 震下手机
  详细解决方案

震下手机

热度:4009   发布时间:2013-02-26 00:00:00.0
震动手机
/*  * 根据客户设置是否震动 * private Vibrator vibrator;  * vibrator = (Vibrator) getSystemService(Service.VIBRATOR_SERVICE); * PublicUtil.vibrator(this, vibrator);* /	public static void vibrator(Context context, Vibrator vibrator) {		SharedPreferences preferences = context.getSharedPreferences(				SYSTEM_SETTINGS, Context.MODE_PRIVATE);		boolean openVibrator = preferences.getBoolean("openVibrate", true);		if (!openVibrator)			return;		vibrator.vibrate(500);//震动0.5s	}

?

  相关解决方案