Toast.MakeText Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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.
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.