How can I show a toast for a specific duration?

前端 未结 12 2198
自闭症患者
自闭症患者 2020-12-08 01:08

This is the way I have to show the Toast for 500 milliseconds. Though, it\'s showing more than a second.

Toast.makeText(LiveChat.this, \"Typing\         


        
12条回答
  •  孤街浪徒
    2020-12-08 01:54

    Can't do what you are asking with the standard Toasts. Perhaps you should think about integrating a 3rd party library that gives you better Toast options (named Crouton). I haven't used it myself, but people seem to like it.

    You can't control the length of Toasts in the standard OS.

    Crouton link: https://github.com/keyboardsurfer/Crouton

提交回复
热议问题