-
(Syntactically) Extend Selection Many Android Studio refactorings require that your cursor has selected an expression (e.g., extract method). Sometimes selecting an expression can be tricky (e.g., when the expression inside of nested parentheses and/or closures). The extend selection action comes in handy big time here.
-
Logging Live Templates Sometimes its useful to log the parameters and/or return value of a method that you’re debugging. Android Studio has live templates that help you do just that.
-
Postfix Templates Sometimes you need a live template to be applied to a particular variable that you’re working with. This can be accomplished through the use of Postfix Templates. As the name suggests, these templates are invoked by appending a period to the variable you want to invoke a template on. After appending the period, invoke autocomplete to see the list of available postfix templates.
-
Smart Completion You can invoke auto completion by pressing Ctrl + Space. This will display a list of possible ways to complete the line of code your typing by, for example, suggesting method calls or variable names. You can further refine the list of completion options displayed to you by using smart completion, which can be invoked by pressing Ctrl + Shift + Space. I want to point out one really neat thing about the way in which the list is refined.…
-
Tab vs. Enter for autocomplete Enter can be used to select an item from an auto complete list. When enter is used, the selected item will simply be inserted into the text at the cursors current position. Pressing tab as a way of selecting an autocomplete list item, however, will replace the symbol currently underneath the cursor with the one that you’ve selected from the autocomplete list.