This question already has an answer here:
I used toasts in my android application. Can I show the toast as long as i wish instead of
Toast.LENGTH_LONG
and
Toast.LENGTH_SHORT
can someone help me with some helpful code segment. Thank you.
This question already has an answer here:
I used toasts in my android application. Can I show the toast as long as i wish instead of
Toast.LENGTH_LONG
and
Toast.LENGTH_SHORT
can someone help me with some helpful code segment. Thank you.
Try this..
Enjoy..
no cannot directly handle that,you have to use handler to cancel the toast like this:
What you can do is create a method which with some kind of looping around to make your Toast display as long as duration you want it,
And then you can call this method as
showToast(10000);
. So, what it will do is it will keep showing the Toast in loop until the duration and will cancel the toast as the duration is completed.