Custom Toast in Android

Email this to someonePrint this pageShare on Google+0Share on Facebook0Tweet about this on TwitterShare on LinkedIn1Share on Reddit0Pin on Pinterest0Share on StumbleUpon3

You are able to create Custom Toast in Android. So, you can display some images like congratulations or loss on the toast. It means you are able to customize the toast now.

activity_main.xml

Drag the component that you want to display on the main activity.

File: activity_main.xml

customtoast.xml

Create another xml file inside the layout directory. Here we are having ImageView and TextView in this xml file.

File: customtoast.xml

Activity class

Now write the code to display the custom toast.

File: MainActivity.java

Output:

Custom Toast in Android

Email this to someonePrint this pageShare on Google+0Share on Facebook0Tweet about this on TwitterShare on LinkedIn1Share on Reddit0Pin on Pinterest0Share on StumbleUpon3

About Team

Browse Archived Articles by Team