What is preferred toast char length in Android?

145 views Asked by At

According to documentation

If your app targets Android 12 (API level 31) or higher, its toast is limited to two lines of text and shows the application icon next to the text. Be aware that the line length of this text varies by screen size, so it's good to make the text as short as possible.

What does as "as short as possible" mean?

The optimal character limit for toast messages may vary across devices, but establishing a minimum threshold is essential. For instance, suggesting a preferred character length below 100 would enable me to instruct the design team to ensure that the text remains within a specified limit.

Any source-code reference would be also beneficial to define min char length.

1

There are 1 answers

0
memres On

Toasts are a very old technic introduced in API Level 1 to show system level feedback to user, which are kind of messages like "Something went wrong", "Operation succeeded." or similar. They are sticky and even stay after your activity is destroyed until their timer (LENGTH_LONG, LENGHT_SHORT) is over. They can not be deleted/ignored or swiped by the user. That's why they must be as short as possible.

I don't know what your use cases are but maybe you can have a look at snackbars. They are also supposed to be used for short feedbacks and supersede the toasts. Have a look at this post for differences between toasts and snackbars.