Android Custom Toast Example - Android Studio
In this tutorial we will learn how to display Custom Toast(with Image, Text) on a Button click using Android Studio. We will create a layout resource file for custom Toast. Step 1: Create a new project OR Open your project Step 2: Place an image in drawable folder(if you want to display the image too) Step 3: Create a Layout resource file named as custom_toast.xml in res>layout folder Step 4: Code custom_toast.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= "match_parent" android:layout_height= "match_parent" android:id= "@+id/custom_toast_layout" android:orientation= "vertical" > <ImageView android:id= "@+id/custom_toast_icon" android:layout_width= "80dp" android:layout_height= "80dp" ...