ctrl+u: If your cursor is within a method of overriding the parent class (for example: Activity#oncreate ()), this will jump to the implementation of the parent class.
If your cursor is on the class name, it will jump to the parent class.
ctrl+alt+home: It can help you navigate between layout files and activity/fragment files easily. There is also a shortcut next to the class name and the top of the layout file
ctrl+alt+v: You can dynamically generate code without having to enter the declaration of a variable and you can modify the variable name directly. The IDE generates a declaration and also gives some suggested variable names.
- If you want to modify the claim type to something more generic (for example: list instead of ArrayList), you can use Shift+tab and it will give you a list of available types.
Alt+j: (I modified Alt+y): It will make the current selection, select the next occurrence and add a cursor. This means you can have multiple cursors in the same file! Everything you enter will be written at each cursor.
. for (For foreach)
. Format (Wrap a string with Stirng.format () )
. Cast (with a type strong turn wrap a statement)
You can use "mylist.for" and press tab and it will generate a loop for you.
ALT + ' (after quotation marks): This can show the most frequently-versioned operation options. If your project is not under Git or any other system, it gives you at least a local history maintained through Android Studio.
alt+f1: ask you where to choose the current file. With all due respect, this is the most useful shortcut key for opening in an engineering structure or in your file explorer. Each action has a prefix for a letter or number, which is a shortcut to quickly invoke it.
Ctrl+shift+delete (Mine is Alt+shift+delete): This will remove the surrounding code. It can remove if, while, Try/catch, or even a runnable. This is exactly the opposite of the surround with (Package code block) shortcut key function.
ctrl+shift+i: have you ever wanted to see the implementation of a method or class on the current page? Use this shortcut key to find it on the current page.
Reference from: http://blog.csdn.net/growth58/article/details/46764575
Respect the fruits of labor, reproduced please specify the source: http://blog.csdn.net/growth58/article/details/46764575
Follow Sina Weibo: @ in Wei
Email: [Email protected]
Common shortcut keys for Android Studio