Summary of Android Studio shortcuts for Windows

Shortcuts, in bold, are often used

describe

Ctrl+E

Open the file of the most recent action

Ctrl+Z

undo

Ctrl+Shift+Z

Redo (Ctrl+Y in Eclipse)

Ctr+Y

Delete the row (delete the row in Eclipse is Ctrl+D)

Ctrl+D

Copy that line down

F11

Add the mouse hover line to Bookmarks, and you can use the Alt+2 shortcut to view all Bookmarks, as well as Favorites and BreakPoints

Ctrl+Alt+ left/right arrow

Walk through your navigation actions (such as cursor movement, TAB switching, and file opening)

Alt+ left and right arrows

You can toggle left and right in all files that are already open

Alt+ numbers 1, 2, 3, 4, 5, 6

You can open the corresponding tool buttons (located on the left, bottom, and right side of Android Studio, and some of them have a corresponding small number) and use Alt+ the corresponding number to turn them on or off

Ctrl+Shift+V

Copy history

Ctrl+Alt+Shift+C

Copy a logical reference to a method, variable, or class that automatically imports the required qualifiers and import statements when pasted into another source file

Ctrl+Shift+A

It’s useful to type in what you want to search for (features and features of Android Studio) and get results

Alt+F1

Select In dialog box appears, you can carry out some convenient operations, although easy to use but not as good as using the mouse

Ctrl+N

Enter the name of the class in the pop-up dialog box to directly open the class, great

Ctrl+Shift+N

Enter the name of the file in the pop-up dialog box to directly open the file, more than the previous file can be opened

Ctrl+G

You can enter the number of rows you want to reach or the number of rows: column number, useful when the file is long

Ctrl+Alt+Home

You can open a file associated with the current file, such as mainactivity.java, and its associated file will be activity_main.xml, which your colleagues will never know

Ctrl+H

If you look at the inheritance of the current class (which is only valid in Java files), you’ll see that Alt+8 has the same effect

Ctrl+ number plus sign

Expand the collapsed code block at the cursor location

Ctrl+ number minus sign

Collapses the expanded block of code at the cursor location

Ctrl+Shift+ number + sign

Expand all collapsed code blocks

Ctrl+Shift+ number minus

Collapses all expanded code blocks

Ctrl + space

If you still want to use this shortcut key, either change it to Ctrl+3 or modify the registry. Method one, method two

Alt+Enter

When a new class is introduced but not yet imported, just use this shortcut key against the name of the class to automatically import

Shift+Enter

It is very convenient to jump from the current line to the next line without placing the cursor at the end of the current line and then pressing Enter

Alt+/

This is also a code tip, but this tip just provides the words used in the file, looped up

Alt+Shift+/

Again, the code hints only provide the words that have been used in the file, looping down

Ctrl+/

Code comments, for single line, can also choose multiple lines, the most used, do not need my emphasis

Ctrl+Shift+/

Block comments

Alt+Insert

Exhale Generate command, strong Amway

Ctrl+J

Insert the code template, or if you remember the name of the code template, such as FBC, followed by Ctrl+J, you can simply insert () findViewById(R.id.).

Ctrl+Alt+J

After selecting a word, use this shortcut key to directly exhale the template, and select the one you want

Ctrl+Shift+ up arrow/Down arrow

Moves one or more statements up/down the scope, or if a code block is moved, the entire code block moves together to the next syntactically correct location

Alt+Shift+ up arrow/Down arrow

Move one or more statements up or down regardless of scope or syntax

Ctrl+Alt+I

According to the scheme set in Code Style, indent the current mouse line or selected lines to keep the Code beautiful

Ctrl+Alt+O

Organization import statement

Ctrl+Alt+L

Reorganize the code format of the file

Ctrl+Alt+T

Select the statement that you want wrapped, and use this shortcut to quickly wrap it with try catch, if/else, for, or for each

Ctrl+Shift+Delete

Select statements that you don’t want wrapped, and use change shortcuts to remove blocks such as try catch, if/else, for, or for each

Ctrl+Alt+Shift+T

Refactor This dialog box, you can do a lot of things about refactoring. The four shortcuts can be remembered as CAST

Shift+F6

Rename the file

Ctrl+F6

Modify the method name and parameters

Ctrl+Shift+F6

Type migration

F6

Move files or variables to another file

F5

Copy files or variables to another file

Home

Place the cursor before the first letter of the current line

End

Place the cursor at the end of the current line

Ctrl+Alt+V

Extract variable

Ctrl+Alt+C

Extract constant

Ctrl+Alt+F

Field Extraction

Ctrl+Alt+P

Extraction of parameters

Ctrl+Alt+M

Extraction Method

Ctrl+K

Git Commit changes

Shift+F10

Run the project

Ctrl+Alt+S

Set up the

Ctrl+Alt+Shift+S

Project structure setting