The article directories

  • Quickly view method comments
  • Remove useless import shortcuts
  • Convert to uppercase shortcut key
  • Try catch shortcut
  • Overrides a parent class method in a subclass
  • Quickly Generate
  • Restore the file you just closed
  • Quickly locate the error code in the current file
  • TODO comment
  • Find summary shortcuts
  • Summary of line operation shortcut keys

Quickly view method comments

ctrl+Q

Premise A method can only view comments this way if it has a canonical comment, such as the setInflater() method shown above

/** * Set the value of LayoutInflater.@linkCall */ after #setContext(Context Context)}
private void setInflater(a){
	inflater = LayoutInflater.from(context);
}
Copy the code

To add a comment, type /** and press Enter

If other methods are included, the format is as follows

{@link #setContext(Context context)}
Copy the code

Remove useless import shortcuts

Ctrl+Alt+O

Convert to uppercase shortcut key

Ctrl+Shift+U

Try catch shortcut

Mouse select the code to try catch, if a line of code can be mouse over the line

Alt+Ctrl+T

Overrides a parent class method in a subclass

Ctrl+O to extract the code in a separate method Ctrl+Alt+M

Quickly Generate

Alt+Ins

Restore the file you just closed

Ctrl + Alt + please

Quickly locate the error code in the current file

Current file error, although there is an error on the right side, but carefully drag to the corresponding location is not fast…

Use a shortcut key to quickly locate the current error location:

Shift+F2

TODO comment

When you don’t write a method after adding it, you can write a TODO comment so you don’t forget to finish

//TODO
Copy the code

The inputtodo, AS will automatically complete



This will give you a blue line on the right side of Android Studio, indicating that you have unfinished work

Find summary shortcuts

1, Find Actions. What it does: You can call any known menu or action by its name. This is useful for occasional commands that Enter does

ctrl+shift+a



2. Quick Definition Lookup Purpose: Want to see the implementation of a method or class without losing the current page? Use this shortcut to find it

ctrl+shift+i



3, The Call Hierarchy Popup. What it does: This tells you the possible path between a method’s declaration and its invocation

ctrl+alt+h



4, The File Structure Popup. What it does: This shortcut allows you to view the outline of the current class, which you can filter by clicking the keyboard

ctrl+f12

Summary of line operation shortcut keys

1. Delete Line. Action: Deletes a row

ctrl+y

2, Move Lines Up/Down. Action: Moves a row up or down

alt+shift+up/down

3, Collapse Expand Code Block Action: Folds and expands code

ctrl+shift+plus/minus

Tip: Default folding or not can be set here

4, Move Between Methods and Inner Classes. Action: Moves the cursor to the next method or class in the current file. If the cursor is in the current method, press Alt+↑ to move the cursor to the current method name

alt+up/down



Highlight All the Things. What it does: Highlights current related content, not just a simple match, but only related content

ctrl+shift+f7

You can look up the next one by F3

Press ECS to exit highlighting

Highlight a reference. Where is it used is also highlighted

If “extends” or “implements” is highlighted, methods such as overwritten methods are also highlighted

Highlighting the “return” or “throw” statement also highlights all exit points for the method