A Toast alert message appears on the Android screen for a brief period of time. Android Toast is a quick popup notification that displays information during app operations.
In this tutorial, we will not only limit ourselves to making a lousy toast, but we will also include some user interaction.
First, we'll develop a screen with an Edit Text and a Button.
There are many way to used Toast in Mobile application
- when user register successfully or failed
- when user login successfully or failed
- when user not found in database and man
Step-by-Step Implementation
Step 1: Create a New Project in Android Studio (File >new project).
Step 2: Create an activity_main.xml file in your layout folder . path (res>layout)
Implement the same invoke the following code inside activity_main.xml file.
Step 3: Create an MainActivity.kt file in your package folder .
Implement the same invoke the following code inside MainActivity.kt file.
Step 4 : Output of above example
Happy coding!