How can I include a button in a Toast notification?

后端 未结 5 1901
广开言路
广开言路 2020-12-12 23:05

First of all, I know this has been asked before: Button in custom Android Toast?. This is nearly an exact duplicate, but I think that it warrants a new question based on the

5条回答
  •  甜味超标
    2020-12-12 23:34

    Gmail on iOS does provide a toast and it is a much better solution than interrupting the user flow with a dialog.

    ![Toast style message in Gmail for iOS][1] [1]: http://i.stack.imgur.com/LWClq.jpg

    If you use this option, make sure the toast is displayed long enough for the user to tap undo if needed. So 5 seconds as opposed to 2.5-3 seconds in a info-only toast.

    The other example cited by CommonsWare is the inline feedback which is shown after a swipe gesture. This is not a toast- but it is also a great way to provide feedback that an action has been performed.

提交回复
热议问题