Android Studio Annotation Template Introduction _android

Source: Internet
Author: User

Hey, guys. It's not customary to go from Eclipse to Android studio, it's easy to use the Eclipse method annotation template, Knock/** plus carriage return, template loaded out, and Android Studio is not customizable, now use live Templates instead, the specific way through the picture and text to show the following:

Steps

1.file->setting->editor->live Templates

2. Click + to create a template Group

3. Fill in the group name you want, my name is custom

4. Select the group you just created to create a live Template

5. Fill in abbreviation, I fill in here is CMT, also that you this annotation shortcut, you knock CMT plus return, the template came out

Template text is a template for annotations, you can specify how you want to write the template, my template is as follows

6. To set your CMT shortcut key where the effective, my choice is in the declaration of the time of entry into force, that is, you in the method name to play CMT plus carriage return on it

7. Note that my template text has a definition of three variables desc,date,time, the back two I want to generate the date and time, so we want to edit these two variables

Click Edit variables, in the window, date and time are set to the corresponding method, date () This method will generate a date () This method will generate a

8. Click Apply all completed .

Now, if you hit the CMT carriage return on the method name, the annotation template will be generated automatically, the effect is as follows, the time is automatically generated

Follow the above steps to operate the Android Studio annotation template is achieved, I hope to help you, thank you.

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.