How can I show a toast for a specific duration?

前端 未结 12 2157
自闭症患者
自闭症患者 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条回答
  •  萌比男神i
    2020-12-08 01:43

    This can't be done. The values of Toast.LENGTH_SHORT and Toast.LENGTH_LONG are 0 and 1. This means they are treated as flags rather than actual durations so I don't think it will be possible to set the duration to anything other than these values.

提交回复
热议问题