Problem: How to give alert message (text notification) to the user of the application?
It is known as Toast notification in Android.
- It is non-interactive message.
- It is used to display text notifications(message) to the user.
- It automatically fades-in and fade-out on the surface of the window/screen.
- It covers only the area which is required by the message.
Toast.makeText(this,"This is the Text Notification Demo", Toast.LENGTH_SHORT);
Context context = this; String text = "This is the Text Notification Demo"; int duration = 1000; Toast.makeText(context, text, duration).show();