Summary of Android Studio shortcut keys

Source: Internet
Author: User

Moving from Eclipse to Android Studio is a painful process, but a sweet start.
A new job, is used as developed, before with eclipse feel very good, suddenly with as Instant Meng forced, engaged for three days, just did not understand, fortunately the middle of a day off, watched a day video, summed up the next, found as is a magical site, oh no, is a magical tool, Eclipse can be uninstalled! Not much nonsense to say, summed up as follows: (Welcome to correct the supplement)

1. When the code is automatically generated, the package is automatically imported into it: File–settings-editor–general–auto import selects the hooks in front of the two lines of optimize imports and add unambiguous

One, log print: (Studio case-sensitive)
1, automatically generated TAG value: logt+ Enter-–>>>--private static final String tag= "mainactivity";
2. Automatic generation of LOG.D function: Logd-->>>--log.d (TAG, "on Create are call");
3. The log.d value of the method parameter is automatically generated in the method: Logm-->>>-log.d (TAG, "onCreate () called with");

Second, code hint: (Studio case-sensitive)
1, prompt related code: ctrl+alt+ space

Third, Code movement: (Studio case-sensitive)
1. Move the code up or down: ctrl+shift+↑ or ↓
2. Copy the current line code to the next line: Ctrl+d
3, delete: Ctrl+y; cut: ctrl+x; Copy: Ctrl + C; paste: ctr+v;
4. Move between methods in a class: Alt+↑ or ↓
5. Check code: CTRL+W

Four, Code view: (Studio case-sensitive)
1, open a class (. Java): Crtl+n
2, open a file (. xml, etc.): Ctrl+shift+n
3, see where a method was called: Ctrl+alt+h
4, See the implementation of a method in the class (directly popup the contents of the window Display method): Ctrl+shift+i
5, display the inheritance structure of the class diagram: Ctrl+h
6, return the last cursor position (equivalent to the browser's forward backward): ctrl+alt+←
7, Previous file, next file: alt+← or →
8, lines of code display and expand: Ctrl+plus
9, substituting or hiding the left engineering panel: alt+1
10, Quick Find method in class or global variable: ctrl+shift+alt+n
11. Display the list of methods and global variables in the current class (check find anonymous inner Class): Ctrl+f12
12, overriding the parent class method: Ctrl+o
13, quick position curly brace at the beginning of the end: ctrl+[or]
14, select a piece of code, Quick add if, try catch, for loop statements: Ctrl+alt+t
15, find the layout file from activity: Hold CTRL + LEFT mouse button on the leftmost side of activity
to view the parent class of a class: Ctrl+u
View a variable's declaration place: Ctrl+b or CTRL + left mouse button
Double shift:search Everywhere

Five, automatic code generation shortcut key: "Very important, can improve the speed of writing code": (Studio case-sensitive)
1, automatic prompt code template popup: Ctrl+j "inside a lot, slowly use, slowly remember"
Quick introduction to commonly used templates:
Ifn-if (xxxx = = null) {}
Inn-if (xxxx! =null) {}
fori–for (int i = 0;i<;i++) {}
fbc-(). Findviewbyid ();
Visible ——. setvisibility (view.visible);
Toast (Uppercase T) ——-Toast.maketext (Mainactivity.this, "", Toast.length_short). Show ();
2.alt+ Enter: Auto Fix universal key

Vi. code Lookup, substitution, and formatting:
1. Find text: ctrl+f
2. Replacement text: Ctrl+r
3. Open a file that has been recently opened: Ctrl+e
4. Format code (may conflict with QQ password unlock shortcut key): Ctrl+alt+l

Seven, debug debug:
1. Add breakpoint: The leftmost side of a line, left-click
2. F8: Continue to the next step
3. F7: Entry method
4, Shift+f8: Jump to the next breakpoint
5, do not change the source code to add log printing: Click on the dot point of the breakpoint-pop-up box-and then click on the Suspend front of the checkbox-pop-up box-check the log evaluated expression--write the content to be printed in the input field (double quotation mark "test")
6, in the variables right click on the variable, you can change the value of the variable, to change the logical execution of the breakpoint

The above summary is from the MU class net to see, want to see the video can go: http://www.imooc.com/learn/650

May 6 Added
Commonly used in work:
Automatic addition of Get/set methods: Alt+inset

Summary of Android Studio shortcut keys

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.