MakeText() is the method we have to use which takes in three parameters, Let's see each of these parameters one-by-one, The above code snippet is the structure of creating a Toast object and setting a "Text" message and its "Duration" Some examples where you can an Android Toast Message be helpful:Įxample 1: We have an Email application and the user deletes an email, then when that email is been deleted we can display a Toast message saying "Email has been deleted"Įxample 2: At login, if the email id or password is incorrect we can display a toast message saying "Invalid id or password"Įxample 3: When a message has been sent, we can notify the user "Message sent" using toast messages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |