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
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.