For a year now, I started trying to program for Android, and throughout the year I was supported by a good friend of Android Studio . Of course, I would have moved much faster, if I knew more about hot keys, I didn’t find an integral and clear directory of important IDE hot keys at one time, and therefore wrote it myself. Not all combinations are in it, only those that seemed useful in their work, with the exception of Ctrl + C, Ctrl + V, Ctrl + X and Ctrl + Z. I expose it to the public and for public use here:
Quick bug fix / Quick bug fix Alt + Enter
Displays a window with options for displaying errors, if more than one.
Wrap in ... / Surround with ... Ctrl + Alt + T ')
List of more than ten options. Here you have both try-catch and if / else, and synchronized, and Runnable ... So to say, a wrapper for every taste.
Current Class Information / Context info Alt + Q
The name, appearance, abstraction, parents - a complete dossier.
Change signature / Change signature Ctrl + F6
Very handy tool, even if the task itself is not worth a jigger.
Screenshot for clarity
Recent changes in the project / Recent changes Alt + Shift + C
Not very detailed, but help remember.
Display type hierarchy Ctrl + H
Prints a type tree up to the top one up to which the pointer is on.
Example instead of a thousand words
Go to source / Jump to source F4 (Win) / CMD + down-arrow (Mac)
No comments required
Go to announcement / Go to Declaration CTRL + B (Win) / CMD + B (Mac)
Go to parent / Go to Super CTRL + U (Win) / CMD + Y (Mac)
Search by element name / Search symbol of name CTRL + ALT + SHIFT + N (Win) / OPTION + CMD + O (Mac)
Sometimes unnecessarily long, and sometimes just necessary
Show API / Show docs for selected API documentation. CTRL + Q (Win) / F1 (Mac)
Example
Show method parameters / Show parameters for selected method Ctrl + P
Example
View element definition / Quick definition Ctrl + Shift + I
Example
Reformatting code / Reformat CTRL + ALT + L (Win) / OPTION + CMD + L (Mac)
Allows you to optimize imports (optimize imports) and reorganize code fragments (rearrangement entries) at the file level, directory, or just the selected text. Reformatting the code includes grouping overriden methods by class / interface, grouping getters and setters, and ordering methods by depth of entry (for example, if the foo () method in your body is called bar (), then the bar () method will be moved immediately under the foo () method, if it does not violate the structure of the code) and useful detail such as a space at the beginning of the substring to be glued to the end. The reorganization is quite flexibly configured via File | Settings | Code Styles, select Java in the drop-down list and go to the Rearrangement tab.
Generate method / Generate method ALT + Insert (Win) / CMD + N (Mac)
Constructors, getters / setters, equals (), toString, and the override method and delegate method functions are offered for selection. In general, very cool and good for the body.
Build CTRL + F9 (Win) / CMD + F9 (Mac)
Just builds.
Build and Run SHIFT + F10 (Win) / CTRL + R (Mac)
Not only builds.
These are, in my opinion, the most useful hotcakes that I used or would use if I knew about them before. To summarize, Android Studio has the potential of the so-called “invisible interface”, which makes life easier for simple coders.
PS Note to beginners from beginner: If you are used to Ctrl + Z - cancel and Ctrl + Y - cancel cancel, wean yourself! Cancel really Ctrl + Z, but the cancellation cancel Ctrl + Shift + Z.