Custom Android Toast - How to Create a Custom Toast in Android
http://www.viralandroid.com/2015/09/custom-android-toast-example.html
Related:
How to Display Simple Toast Message in Android
Android Snackbar Using Design Support Library
Android Action Bar Tutorial and Example With Option Menu
How to Display Custom Toast in Android App
Just follow the following simple steps to display custom android toast message.
Create an XML Layout File
To display custom toast, you have to create an xml layout file and add what you want to display in the toast. Here, I have created a custom_toast.xml file and it looks like this.
res/layout/custom_toast.xml
Modify XML Activity Layout File
Add a button to your activity_main.xml file and it looks like this.
res/layout/activity_main.xml
Modify Your Java Activity File
This is the modified code of java activity.
src/MainActivity.java
The job you have to do is over. Now, run your application which looks like this.
Custom Toast |