There used to be a shortcut or a way that auto fills the entire line for you while you are writing
(without having to select it from the dropdown)
example
Toast.
becomes Toast.makeText(this, "", Toast.LENGTH_SHORT).show();
I believe you are look for the "Complete statement" shortcut:
Windows/Linux: Control+Shift+Enter
Mac: Command++Shift+Enter
Though from your example, Toast. would become: Toast.makeText();
Whereas without the dot, Toast would become: Toast.makeText(this, "", Toast.LENGTH_SHORT).show();
Then you'd select your param values, hitting enter to progress through each one.
Source: Android Studio Keyboard shortcuts
Related
Whenever I press Ctrl + / to comment out a line in Android Studio in a C++ file, it just moves the caret down 1 line without making a comment. Creating a different keybinding for this shortcut has the same effect.
I've used this feature fine before, it only started happening when I opened up android studio today. I've tried disabling all plugins and restarting Android Studio to no avail.
If the keyboard shortcut doesn't work. Then try
Alt + Shift + Insert
What It will do is activate column selection mode, making it easy to just click and drag to select multiple lines of code that you can type on. It's easier than trying to make an entirely new keyboard shortcut.
The other way to do Column Selection Mode is to just right click anywhere on the code and it will be in menu popup, click to activate/de-activate.
I use Android Studio 3.01, it will display the wrong hint "Expecting member declaration" when there are some problem with my code.
But the text information of the wrong hint is hard to copy, it will be disappear immediately if the mouse is out of the hint area. I hardly to select the text of hint and click Copy item from Right-click menu.
Is there a simple way to do it? such as keyboard shortcuts.
Add Content
Many times that both the error hint and keyword hint are displayed simultaneously!
You may take a look to this question :
How to copy error message in Android Studio tooltip
which contain the answer:
Once popup shows up, move your mouse pointer over it and simply select (mark) bubble's text, then do Copy with keyboard shortcut (CTRL+C on Windows or Command+C on Mac) while still having mouse pointer over the bubble.
In Android Studio I changed the tab key function from file > settings > keymap. I chose to remove all other bindings from tab key (mistake!!). And now I can't get auto-complete to work like before.
I want to select an item from the auto-complete pop-up then press tab to complete the word (I think this the default behaviour):
But when I press tab it "completes the sentence" and puts my cursor at the end of the line:
I don't want this, I want to just complete the word and the cursor to stay in place. This is my current configuration for tab:
How do I get the default behaviour back? I really don't want to reinstall Android Studio and it is driving me crazy.
--------------- edit ---------------
"Complete current statement" binding doesn't work:
Now when I press tab nothing happens, it doesn't auto complete at all.
Found the problem. Had to bind "Choose lookup item replace" to tab key to get the default / correct behaviour.
While we are typing a string is there any way, except pressing right arrow button, to go out of double quotation in Android studio or intellij-idea(for example a kind of shortcut or something)
If it inserts a comma and goes to next empty field it would be better also.
for example:
Log.i("stingLogName|") ==> Log.i("stingLogName", |)
(i've shown blinking cursor with |)
You can achieve this in Android Studio (and of course in intelij) with Live Templates.
But you can move from field to field with Tab button (default) or if you want Space or Enter by selecting it in the Live Templates settings.
Usage:
Open Android Studio and place the cursor inside a statment (the OnCreate method for example)
Type logi and press Tab ( or type Ctrl+J and select an element from the list)
You can find more information here IntelliJ Live Templates
Hope it helps
I just installed my Visual Basic and this is a problem I couldnt find an answer to. Everytime I press ALT it gets me out of code, and because I use SHIFT+ALT to change keyboards a lot while writing code, this is really disturbing to have to click in code again to be able to write.
Any ideas ?
Are you referring to the normal Windows way of accessing the menu via keyboard? This has nothing to do with Visual Studio; it will work similarly in almost any Windows application.
E.g. pressing Alt+F will open the File Menu etc. Just pressing Alt will highlight the menu (you should see the shortcut letters underlined for each item) and pressing a letter key will then open the menu. Instead, press Alt again to return to what you were doing before.