Which of following is incorrect about the Toast class?
Which of following is incorrect about the Toast class?
A Toast can be created by the Context class, which is not limited to just Activity. Instances like Service can also display Toast messages. This makes the statement 'A Toast can only be created by an Activity class' incorrect. Toasts indeed don't need to be explicitly closed as they disappear automatically after a short duration, and they cannot have a custom layout. Additionally, Toasts are displayed for predefined durations specified by Toast.LENGTH_SHORT or Toast.LENGTH_LONG.
B. A Toast can only be created by an Activity class