Android development-Tomast and androidtomast
The first time I published an article in the blog, I will share with you the prompt settings I just learned about Android development.
Tomast is a frequently used method in Android. It is used for simple user prompts. After exploring it, I found two ways to use Tomast. I will share it with you.
The first default method is as follows:
Toast. makeText (getApplicationContext (), "the system prompts", Toast. LENGTH_SHORT). show ();
The second custom mode:
Toast toast = new Toast (getApplicationContext ());
Toast. setGravity (Gravity. CENTER_VERTICAL, 0, 0); // you can specify the display position.
Toast. setDuration (Toast. LENGTH_LONG); // you can specify the display time.
Toast. setView (getLayoutInflater (). inflate (R. layout. activity_two, null); // you can specify a custom view.
Toast. show ();
View displayed in custom mode:
<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 format prompt"
Android: textSize = "20dip"
/>
</LinearLayout>
I personally feel that the difficulty for custom Tomast lies in the introduction of views. I hope the gods can provide more guidance.
Which of the following is a good example of Google Android SDK development?
I personally think that if you are a newbie and want to learn about Android and do not use the mars video tutorial or platform development, you will have a great trip, if you need to make something to illustrate how to cover more things, you can give a lot of reference. Weak wood has little access to or comes into contact with Android, just like a couple of such drops or two get started, eight times. Example: Is there an electronic file platform development? Even wood has a bottom ....
Android development self-learning path
Android is based on java code, so you must first learn the basic java code, that is, java se, without learning java EE. Then you can learn about Android.
The Innovation Office has some Android videos, which are relatively complete. You can check them out.