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 fact that it's been used in apps, namely Gmail for ICS (it appears when you delete a message).
The linked question says that it's not possible to include a button in a Toast
because Toast
s cannot be focused. Is this wrong, outdated, or did Gmail find a way around it?
You can include action Buttons into toast by adding buttons property. You can bind collections of Essential JS 2 Button Model to model property inside buttons property, You can also include click event callback function, for each button.
A toast is a small display on the bottom of the screen. A notification is displayed in the top menu bar.
A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. Toasts automatically disappear after a timeout.
The Gmail undo bar is't a toast, here is how Google did it
http://code.google.com/p/romannurik-code/source/browse/misc/undobar/src/com/example/android/undobar/UndoBarController.java
I guess this answers your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With