From c4f850fc0089be1525b393aa6d2df81e18f83faa Mon Sep 17 00:00:00 2001 From: Amy Gu Date: Thu, 18 May 2023 21:45:21 +0000 Subject: [PATCH] Update docs to reflect that toast should take activity context, not application context. Bug: 283021971 Change-Id: I33baf3bc1c09341c9b548c733ecc83adca5cd7fa --- core/java/android/widget/Toast.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java index fceee4e01799d..f00ac1d1e0637 100644 --- a/core/java/android/widget/Toast.java +++ b/core/java/android/widget/Toast.java @@ -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}