When using setDuration() for a Toast, is it possible to set a custom length or at least something longer than Toast.LENGTH_LONG?
When using setDuration() for a Toast, is it possible to set a custom length
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The values of
LENGTH_SHORTandLENGTH_LONGare 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.If you want to display a message to the user for longer, consider a Status Bar Notification. Status Bar Notifications can be programmatically canceled when they are no longer relevant.