Alt + Enter does not work in Android Studio

Alt + Enter for import was working fine until I updated Android Studio, now my version is 2.3.3

like this screenshot, I cannot press alt + enter at all, knowing that I tested them on other programs and they work fine enter image description here

+11
source share
12 answers

Use LEFT Alt Key + Enter . It works fine in Android Studio 3.0.1.

+12
source

Today I faced the same problem, that’s how I solved it.

  • Go to File > Settings > Editor > General > Auto Import
  • Uncheck the box and check Show Import Popup
  • Make Invalidate caches and Restart for Android Studio. (If this option does not work, restart the computer.

Edit Another solution I found to work is to uninstall Android Studio and reinstall it.

+2
source

It seems strange to me, because I'm sure my keyboard works fine, and the studio settings for Android are fine, but I just see a popup suggestion for importing classes, and nothing happens when I press Alt + Enter.

I am working on Windows 10, and the Android SDK on another hard drive (E :) from the installation of Android Studio (C :), I’m not sure that they contribute to this problem.

After some trial and error, I accidentally solved the problem by pressing "Windows Key + Alt + Enter" to bring up the import class menu and then press Enter again to correctly import the proposed class.

+2
source

enter image description here

For Windows / Linux, you can go to File β†’ Settings β†’ Editor β†’ General β†’ Auto Import β†’ Java and make the following changes:

  • change the value of Insert imports on paste to All if ask or none to All

  • Check the Add unambigious imports on the fly option as checked

On Mac, do the same in Android Studio Preferences

+1
source

I ran into the same problem and was sure that the problem was in Android Studio. But when I reinstalled it, I realized that it did not help. So I decided to test my keyboard. I found that my left Alt does not work with Enter and right Alt when you turn on the Ctrl key. This is why Alt + Enter did not work in any combination. The problem was resolved by reinstalling the keyboard driver. Hope this helps someone.

+1
source

Switch to the "File" and "Not Verified" modes.

+1
source

in Android Studio 3.2.1, the Alt + Enter key combination is used only on the left side of the keyboard.

If you want to use Alt on the right, you need to select it manually from the section

Settings> Key Map> Other

Right click on row

show intention of action

select add keyboard shortcut Press Alt (right) + Enter

hope this helps

enter image description here

enter image description here

enter image description here

enter image description here

+1
source

If someone is facing this problem now, for me it was a change in the language on the keyboard. I must have made some weird key combination that changed the language, so ALT + ENTER didn't really work, I thought it should be. Switching back to ENG made it work correctly. Greetings.

0
source

I thought that I had the same problem and none of the above solved the problem. I thought I was using Alt + Enter for parameter information. Now I use Ctrl + p to get the parameter information for the widget. Not sure if this has been changed from Alt + Enter to Ctrl + p, but if you look at File / Setting / Keymap, it shows Ctrl + P.

0
source

I just ran into this, and what worked, Alt + Insert combination

0
source

it was a problem with the latest version ... instead of pressing alt + enter. use ctr + o, a dialog box will open, then select the method you want to implement and click OK. It works with all versions of android studio. {Happy coding;)}

0
source

The first thing you should check is whether you put the code in the onCreate function? If you don’t put it there and try again. Alt + Enter will work after that.

0
source

Source: https://habr.com/ru/post/1271535/


All Articles