For the first time in the blog Park to publish the article, I just figured out about the Android development of the prompt settings, share to everyone.
Tomast is often used in Android, a method used for simple user hints, after groping I found the tomast of the two ways to use, first of all, share a bit, but also look at the master advice.
The first system defaults to the way:
Toast.maketext (Getapplicationcontext (), "System comes with hint form", toast.length_short). Show ();
The second way of customizing:
Toast toast = new Toast (Getapplicationcontext ());
Toast.setgravity (gravity.center_vertical, 0, 0);//Setting the location of the display
Toast.setduration (Toast.length_long);//Set the displayed time
Toast.setview (Getlayoutinflater (). Inflate (R.layout.activity_two,null));//Set a custom view
Toast.show ();
Views displayed in the customization:
<linearlayout
Android:id= "@+id/linearlayout1"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:orientation= "Horizontal"
>
<imageview
android:background= "@drawable/fire_eye_alien"
Android:layout_width= "50dip"
android:layout_height= "50dip"
/>
<textview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_gravity= "Center_vertical"
android:text= "Custom Form Hints"
Android:textsize= "20dip"
/>
</LinearLayout>
Personal feeling for the tomast of the custom type, the difficulty lies in the introduction of the view, hoping that the great God can give more guidance.