다음을 통해 공유


VibrationEffect.CreateOneShot(Int64, Int32) Method

Definition

Create a one shot vibration.

[Android.Runtime.Register("createOneShot", "(JI)Landroid/os/VibrationEffect;", "", ApiSince=26)]
public static Android.OS.VibrationEffect? CreateOneShot (long milliseconds, int amplitude);
[<Android.Runtime.Register("createOneShot", "(JI)Landroid/os/VibrationEffect;", "", ApiSince=26)>]
static member CreateOneShot : int64 * int -> Android.OS.VibrationEffect

Parameters

milliseconds
Int64

The number of milliseconds to vibrate. This must be a positive number.

amplitude
Int32

The strength of the vibration. This must be a value between 1 and 255, or #DEFAULT_AMPLITUDE.

Returns

The desired effect.

Attributes

Remarks

Create a one shot vibration.

One shot vibrations will vibrate constantly for the specified period of time at the specified amplitude, and then stop.

Java documentation for android.os.VibrationEffect.createOneShot(long, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to