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”/>…

Android Listview From Array
Android Source / July 25, 2017

Android Listview ia group of several item. It display of  scrollable list. This list automatically add in the list item form array. We use locally array or use database like json. Here we data insert form arraylist and sent to data adapter view. This data  can shows different whay like list view, grid view and spinner etc. This Listview and Gridview are subclasses for Adapter, Which save data from another source and view in list. It is a simple android listview from array. We can customize any time from arraylist.   Example: First Create Project in android studio Android XML CODE: <?xml version=“1.0” encoding=“utf-8”?> <android.support.constraint.ConstraintLayout   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:layout_height=“match_parent”   android:background=“@drawable/bg_appslayout”   tools:context=“com.layout.apps.listviewfromarray.MainActivity”>   <ListView       android:id=“@+id/listView”       android:background=“#64ffffff”       android:layout_width=“fill_parent”       android:layout_height=“wrap_content”       android:layout_alignParentTop=“true”       android:layout_centerHorizontal=“true”       tools:layout_editor_absoluteY=“0dp”       tools:layout_editor_absoluteX=“8dp” /> </android.support.constraint.ConstraintLayout>           Java Code: package com.layout.apps.listviewfromarray;   //————SM—————– import android.content.DialogInterface; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; public class MainActivity extends AppCompatActivity {   ListView listView;   @Override   protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);         // Define string array.       final String[] listValue = new String[] {“One”,“Two”,“Three”,“Four”,“Five”,“Six”,“Seven”,“Eight”,“Nine”,“Ten”,“Eleven”,“Twelve”,“Thirteen”,“Fourteen”,“Fifteen”,               “Sixteen”,“Seventeen”,“Eighteen”,“Nineteen”,“Twenty”}; // array list                 listView = (ListView)findViewById(R.id.listView);  //listView string show           ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.select_dialog_item, android.R.id.text1, listValue);           listView.setAdapter(adapter);  …