New for Android sdudio template files.

Source: Internet
Author: User

? When you create a new activity today, an empty activity is created, and as will automatically generate an XML file for you, followed by the default code in the activity.
Here, I will be the installation directory of as to turn over ~ ~ ~ ~ finally found the location of this template file ... Template path: Plugins\android\lib\templates can see that there are many folders below
?Let's open the Activities folder.
 ?As you can see, when we create a new activity template name in as, we can find it here ...
then open one and look inside.
Open the root folder:
 ?? Can see, a template inside the file, a total of a few, conveniently copied a outermost folder, change a name, try to change the next ~ ~ To fill in the information you need. Then restart as
Create a new activity:?
You can see that at this point, when you create a new activity, there is a templeteactivity option in the template. This is what I copied and added ...  When created, no difference from the original, it is necessary to fill out a class name, and then, the name of the XML file will follow its own name and change. Complete the new content:?

This is just a simple example of adding an activity, others can be added, such as adapter,fragment and so on ... Of course, the above way, just one of the ways, there is one: click Edit File Templates ...
? First select the category on the left, then click on the upper left corner green "+"

? Then fill in the name of your template. Write some of the default code for your template, such as:

? Click OK to complete the!!!!! The next time you create a new file, select the new template name.
Fill in the class name:
Click OK:

???!!!! Personally feel that this can be better to improve the speed of writing code, reduce a lot of CTRL + C, CTRL + V, renamed ...of course, this way, how to generate XML files, this still do not know how swollen do ~ ~ ~ ~.

New for Android sdudio template files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.