Android Toast Example And Costume Toast Example
Android Source / July 30, 2017

Android Toast is a like notification message pop up. Basically android toast use for show basic information very short time. Android Toast use for only user satisfaction. You can message show long time and short time and use custom android toast by use android XML. You can set image in custom toast in android. We can show any result by use android toast like click here   Now two type android toast Normal android toast view.   Toast.makeText(getApplicationContext(),“Hello! This is Normale Toast”, Toast.LENGTH_SHORT).show();// Toast   Custom android toast view.   LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.activity_custome__toast,(ViewGroup) findViewById(R.id.two));   ImageView images = (ImageView) layout.findViewById(R.id.images); //Custone toast image view images.setImageResource(R.drawable.logo_onlinetech24);   TextView texts = (TextView) layout.findViewById(R.id.texts); //Custone toast text view texts.setText(“Hello! This is Custome Toast”);   Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.setDuration(Toast.LENGTH_LONG); toast.setView(layout); toast.show();     Xml   <?xml version=“1.0” encoding=“utf-8”?> <LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”   xmlns:app=“http://schemas.android.com/apk/res-auto”   xmlns:tools=“http://schemas.android.com/tools”   android:layout_width=“match_parent”   android:background=“#3b3a3a”   android:layout_height=“match_parent”   tools:context=“com.onlinetech24.sm.toast.Custome_Toast”>     <ImageView android:id=“@+id/images”       android:layout_width=“50dp”       android:layout_height=“50dp”       android:layout_marginRight=“10dp” />     <TextView android:id=“@+id/texts”       android:layout_width=“wrap_content”       android:layout_height=“wrap_content”       android:textColor=“#FFF” />   </LinearLayout>   Full Source   1:XML Code activity_main.xml   <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:gravity=”center” android:layout_height=”match_parent” android:background=”#332c2c” tools:context=”com.onlinetech24.sm.toast.MainActivity”>   <Button android:id=”@+id/one” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text=”Normal Toast” android:textColor=”#fff” android:layout_margin=”5dp” android:textStyle=”bold” android:layout_gravity=”center” android:background=”#04444b”/>…