Created
May 17, 2015 12:50
-
-
Save mryp/e0c4832b72fc944b619c to your computer and use it in GitHub Desktop.
バイブレーション(Vibrator)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.VIBRATE" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* バイブレーションを振動させる | |
* @param activity 画面Activity | |
* @param millsec 振動させる時間(ミリ秒) | |
*/ | |
private void vibrate(Activity activity, int millsec) { | |
Vibrator vib = (Vibrator)activity.getSystemService(Activity.VIBRATOR_SERVICE); | |
vib.vibrate(millsec); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment