AND-401 Exam QuestionsBrowse all questions from this exam

AND-401 Exam - Question 56


Which of following is incorrect about the Toast class?

Show Answer
Correct Answer: B

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.

Discussion

1 comment
Sign in to comment
MmadiOption: B
Dec 31, 2022

B. A Toast can only be created by an Activity class