Merge "Update docs to reflect that toast should take activity context, not application context." am: 9ed3c880da

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2597393

Change-Id: I615951d662d890c5b194b364e6f64a8dea2c0ff0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Amy Gu
2023-05-30 17:32:31 +00:00
committed by Automerger Merge Worker

View File

@@ -154,8 +154,7 @@ public class Toast {
* Construct an empty Toast object. You must call {@link #setView} before you
* can call {@link #show}.
*
* @param context The context to use. Usually your {@link android.app.Application}
* or {@link android.app.Activity} object.
* @param context The context to use. Usually your {@link android.app.Activity} object.
*/
public Toast(Context context) {
this(context, null);
@@ -479,8 +478,7 @@ public class Toast {
/**
* Make a standard toast that just contains text.
*
* @param context The context to use. Usually your {@link android.app.Application}
* or {@link android.app.Activity} object.
* @param context The context to use. Usually your {@link android.app.Activity} object.
* @param text The text to show. Can be formatted text.
* @param duration How long to display the message. Either {@link #LENGTH_SHORT} or
* {@link #LENGTH_LONG}
@@ -536,8 +534,7 @@ public class Toast {
/**
* Make a standard toast that just contains text from a resource.
*
* @param context The context to use. Usually your {@link android.app.Application}
* or {@link android.app.Activity} object.
* @param context The context to use. Usually your {@link android.app.Activity} object.
* @param resId The resource id of the string resource to use. Can be formatted text.
* @param duration How long to display the message. Either {@link #LENGTH_SHORT} or
* {@link #LENGTH_LONG}