SoFunction
Updated on 2025-03-11

Android Studio's commonly used shortcut keys function description

Android Studio is an Android development tool developed by Google based on IntelliJ IDEA, which is somewhat similar to EcliPSe ADT. Android Studio provides integrated Android development tools for development and debugging, and build support based on Gradle.

Commonly used shortcut keys for Android Studio

Ctrl+D: Collects two operations: Copy and paste. If there is a selected part, copy the selected part and follow the selected part.

Paste it out. If there is no selected part, copy the line where the cursor is located and paste it out below this line.

Ctrl+space: Press this key combination when entering the code to list the matching classes, method names, member variables, etc., which plays an intelligent prompt.

It is also useful when editing XML files.

Ctrl+down arrow or Ctrl+up arrow: When there is an automatic matching drop-down list, this shortcut key will automatically close the drop-down list.

The cursor moves to the lower/previous line.

Switching the arrangement method of automatic matching drop-down list: There is a "π" icon in the lower right corner of the automatic matching drop-down list, click to select it

It is arranged in two ways: practicality and letters.

Ctrl+slash, Ctrl+shift+slash:

Ctrl+slash: Comment or uncomment the current line or selected code block, in the form of double slashes, i.e. "//"

Ctrl+shift+slash: Comment or uncomment the selected code block, comment in "/…/" mode,

Ctrl+shift+Enter: Automatically match the corresponding syntax structure, such as if, do-while, try-catch and other structures.

Ctrl+F: Search

Ctrl+period: In the automatic matching drop-down list, select the first item

Exclamation mark: In the automatic matching drop-down list, select an item with the return result of boolean by the up and down keys. Pressing the exclamation mark will automatically invert:

Ctrl+Enter: In the automatic matching drop-down list, when there is no selected item, the first item is selected by default.

Ctrl+shift+A: Quickly find menus in android studio.

Ctrl+N: Quickly find class names and files

Ctrl+B: Directly jump to the place where classes, methods, and member variables are defined. The same effect as Ctrl+left mouse button

Ctrl+Alt+B: Query which classes implement the interface where the cursor is located.

Ctrl+Alt+shift+I: Detect code, such as detecting some variables or methods that have been defined but have not been used. The purpose of detection is to improve code efficiency.

+Alt+shift+N: Method or variable to quickly open input.

+shift+F7: Some related things are marked in the highlighted form. Here are three main situations: 1. When the cursor is implemented,

The method name of the class implements the interface will be marked; 2. When the cursor is returned, all exit places of the method will be marked;

3. When the cursor is at the try or throws keyword, it will mark an exception statement.

+Mouse scrolling: can realize horizontal scrolling of the editing interface.

+Alt+V: When the parameters passed in when calling a method are relatively complex expressions, this key combination can be used to reconstruct the variables to simplify the complexity of the code.

Select the expression before combining keys.

Ctrl+D: Compare two jar files. In the same project, select two jar files and press this key combination

+O: When a subclass wants to override the method of the parent class, press this key combination to display the methods of all parent classes. When the key combination corresponding to the interface is Ctrl+I.

+shift+I: Quickly view the method body. If you want to see how a method is implemented, you can move the cursor to the method and press this key combination.

+Q: Move the cursor to the method, press this key combination to quickly view the method's description document.

+~: Switch the style of the editing interface, shortcut key design

+shift+C: Check the latest modifications of the project.

+E: Quickly view recently opened and opened files.

+F6: Classes, methods, and variables can be renamed, and the names will be automatically updated where they are used.

+F1: Quickly open project view, structure view, etc. to view corresponding elements.

+Alt+F7: Check the usage of a class, method, and member variables in the entire project.

+shift+space: When assigning values ​​or passing parameters into a method, list the method name and member variable name that matches the type.

+Alt+T: Select a piece of code, press this key combination to quickly add if, for, try/catch and other statements.

+Tab: Open the interface switching window, keep holding down the Ctrl key, and select the corresponding window to open.

+W: Select the word where the cursor is located (a member variable or method name), press once more to select the statement.

Press it again to select the code block. . . And so on, each additional increase will expand the range of selected level.

Alt+Enter Import package, automatic correction

Ctrl+N Find class

Ctrl+Shift+N Find files

Ctrl+Alt+L Format Code

Ctrl+Alt+O Optimize imported classes and packages

Alt+Insert generates code (such as get, set method, constructor, etc.)

Ctrl+E or Alt+Shift+C Recently changed code

Ctrl+R Replace text

Ctrl+F Find text

Ctrl+Shift+Space automatic completion code

Ctrl+space Code prompt

Ctrl+Alt+Space class name or interface name prompt

Ctrl+P method parameter prompt

Ctrl+Shift+Alt+N Find methods or variables in a class

Alt+Shift+C compares the recently modified code

Shift+F6 Refactoring - Rename

Ctrl+Shift+Press the key first

Ctrl+X Delete the row

Ctrl+D Copy line

Ctrl+/ or Ctrl+Shift+/ Comments (// or /…/)

Ctrl+J automatic code

Ctrl+E Recently opened file

Ctrl+H displays the class structure diagram

Ctrl+Q Display comment document

Alt+F1 Find the location of the code

Alt+1 Quickly open or hide the project panel

Ctrl+Alt+ left/right Return to the last viewed location

Alt+ left/right toggle code view

Alt+ Up/Down Quickly move positioning between methods

Ctrl+Shift+Up/Down The code moves up/down.

F2 or Shift+F2 Highlight error or warning Quick positioning

After the code tag is entered, press Tab to generate the code.

Select the text, press Ctrl+Shift+F7 to highlight all the text, press Esc to highlight and disappear.

Ctrl+W Select the code, and continuous pressing will have other effects

Select the text, press Alt+F3, search for the same text one by one, and highlight it.

Ctrl+Up/Down The cursor jumps to the first or last line

Ctrl+B Quickly open the class or method at the cursor

The most commonly used shortcut keys

+E, can display the list of recently edited files

+Click can close the file

+[or] can jump to the beginning and end of braces

+Shift+Backspace can jump to the last edited place

+F12, can display the structure of the current file

+F7 can query the reference of the current element in the current file, and then press F3 to select it

+N, you can quickly open the class

+Shift+N, you can quickly open files

+Q can see the declaration of the current method

+W can select words, then sentences, then follow functions

+F1 can position the elements being edited in each panel

+P, can display parameter information

+Shift+Insert can select clipboard content and insert it

+Insert can generate constructors/Getter/Setter, etc.

+Alt+V can introduce variables. For example, assign SQL in brackets to a variable

+Alt+T can wrap the code in one piece, such as try/catch

+Up and Alt+Down can move quickly between methods

Summarize

The above is the description of the commonly used shortcut keys for Android Studio introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!