InterviewSolution
Saved Bookmarks
| 1. |
I have one Text sending application. I need to display a popup message to a user when the text will send to other contacts with a message” Text Send Want to do UN Do” and button one “ Undo”. |
|
Answer» When we need to display simple popup message to the USER without interaction then we are creating Toast Message. But you want to display some popup message with Action then we need to create SnackBars. In our scenario we will create a SnakBars with one button “UnDo” and it will display a message to the user “Text has been send, do you want to undo?”. Please follow the below code for more detail: Snackbar.make(getCurrentFocus(), "Message has been sent, Do you want to undo?", Snackbar.LENGTH_SHORT) .setAction("Undo", new View.OnClickListener() { @Override public VOID onClick(View view) { //RETURN his picture } }) .SHOW(); |
|