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.