Android Studio annotation template, androidstudio

Source: Internet
Author: User

Android Studio annotation template, androidstudio

We can see some project documents and we will find that their annotations are well-formed and well-regulated.

If your code is still annotated with simple // or/**/, you can learn how to set the annotation template in Android Studio.

 

First, check the following code:

 

Obviously, this is a standard annotation method. Every parameter of the method is described. Obviously, @ param in this annotation is not artificially typed.

The implementation method is very simple. Enter/** in the previous line of a method and press enter to display the typographical comment. coder only needs to write the parameter meaning after each parameter.

 

 

So:

/** @ Author xqx * @ emil djlxqx@163.com * create at #/3/7 * description: Expert profile page */

What about this personalized comment?

It is also very simple. follow the steps below:

1,

2,

 

3. Click the green plus sign in the upper right corner.

  

 

4. Get a name

   

 

5. In the newly created template Group

  

 

6. Edit the comment Template

  

  

7. Click

Set Dynamic Time

  

 

8. Click the setting comment below to see if the setting comment takes effect.

 

 

9. confirm completion

Check whether the test is successful. Enter the defined name in the Code. The system will prompt you to press Enter.

 

 

 

We add comments on our own initiative.

What if there is a default comment after a new class is created?

Simple:

 

Related Article

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.