Android uses Timer to extend the display time of Toast

Because when calling AlertDialog, there was a problem that the Theme was not right, which made me unable to call Dialog. This is also one of my concerns about Android. Why a Dialog is related to Theme.
Then I can only use Toast's idea. However, the display delay of Toast is fixed, unless you customize it yourself. The original one or two lines of code will be too much after customization. I'm lazy, so I want to continue trying Toast. The easiest way is to use new Toast. No, because it is an interface created in maketext. Just look at its implementation code.
You must also call makeText to use the Toast popup.

public static Toast makeText(@NonNull Context context, @Nullable Looper looper,
            @NonNull CharSequence text, @Duration</

Guess you like

Origin blog.csdn.net/poolooloo/article/details/108531301