? 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.