次の方法で共有


Toast.MakeText Method

Definition

Overloads

MakeText(Context, ICharSequence, ToastLength)

Make a standard toast that just contains text.

MakeText(Context, Int32, ToastLength)

Make a standard toast that just contains text from a resource.

MakeText(Context, String, ToastLength)

Make a standard toast that just contains text.

MakeText(Context, ICharSequence, ToastLength)

Make a standard toast that just contains text.

[Android.Runtime.Register("makeText", "(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;", "")]
public static Android.Widget.Toast? MakeText (Android.Content.Context? context, Java.Lang.ICharSequence? text, Android.Widget.ToastLength duration);
[<Android.Runtime.Register("makeText", "(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;", "")>]
static member MakeText : Android.Content.Context * Java.Lang.ICharSequence * Android.Widget.ToastLength -> Android.Widget.Toast

Parameters

context
Context

The context to use. Usually your android.app.Application or android.app.Activity object.

text
ICharSequence

The text to show. Can be formatted text.

duration
ToastLength

How long to display the message. Either #LENGTH_SHORT or #LENGTH_LONG

Returns

Attributes

Remarks

Make a standard toast that just contains text.

Java documentation for android.widget.Toast.makeText(android.content.Context, java.lang.CharSequence, 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

MakeText(Context, Int32, ToastLength)

Make a standard toast that just contains text from a resource.

[Android.Runtime.Register("makeText", "(Landroid/content/Context;II)Landroid/widget/Toast;", "")]
public static Android.Widget.Toast? MakeText (Android.Content.Context? context, int resId, Android.Widget.ToastLength duration);
[<Android.Runtime.Register("makeText", "(Landroid/content/Context;II)Landroid/widget/Toast;", "")>]
static member MakeText : Android.Content.Context * int * Android.Widget.ToastLength -> Android.Widget.Toast

Parameters

context
Context

The context to use. Usually your android.app.Application or android.app.Activity object.

resId
Int32

The resource id of the string resource to use. Can be formatted text.

duration
ToastLength

How long to display the message. Either #LENGTH_SHORT or #LENGTH_LONG

Returns

Attributes

Exceptions

Remarks

Make a standard toast that just contains text from a resource.

Java documentation for android.widget.Toast.makeText(android.content.Context, int, 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

MakeText(Context, String, ToastLength)

Make a standard toast that just contains text.

public static Android.Widget.Toast? MakeText (Android.Content.Context? context, string? text, Android.Widget.ToastLength duration);
static member MakeText : Android.Content.Context * string * Android.Widget.ToastLength -> Android.Widget.Toast

Parameters

context
Context

The context to use. Usually your android.app.Application or android.app.Activity object.

text
String

The text to show. Can be formatted text.

duration
ToastLength

How long to display the message. Either #LENGTH_SHORT or #LENGTH_LONG

Returns

Remarks

Make a standard toast that just contains text.

Java documentation for android.widget.Toast.makeText(android.content.Context, java.lang.CharSequence, 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