Android studio import class

I am new to Android Studio. I don't know how to import a class into Android Studio using a keyboard shortcut?

I used Ctrl + 1 as Eclipse, but it does not work in Android Studio.

Any solution?

+4
android eclipse android-studio keyboard-shortcuts
Dec 30 '15 at 6:04
source share
6 answers

See that each has its own different ways.

for import you can use Alt + Enter

here is a link for shortcuts for android studio.

for convenience you can do this, you can use the Eclipse shortcuts in Androidstudio

File -> Settings -> Keymap -> <Choose Eclipse from Keymaps dropdown> 
+8
Dec 30 '15 at 6:08
source share

Use the Alt and Enter keys to import.

+4
Dec 30 '15 at 6:06
source share

Alt + Enter in android studio.

Alt + Enter Key Binding

To quickly correct coding errors, the IntelliJ IDE built-in Alt + Enter key binding for error correction (lack of import, assignment variable, missing links, etc.), if possible, and if not, offer the most likely solution.

Please read Android Studio Tips and Tricks

+2
Dec 30 '15 at 6:18
source share
  • step 1> click on the red error code
  • Step 2> Alt + Enter , and you will receive a list of recommendations for resolving the error.
  • Step 3> If an import class is available in the list, select it by pressing the Enter key and the class is automatically imported.
+1
Dec 30 '15 at 6:18
source share

In addition, it is worth noting that you can automatically import classes into Android Studio. Just find it in the settings and check "Add unambiguous import on the fly."

+1
Dec 30 '15 at 6:26
source share

1.step 1 β†’ Where the red error code is displayed, click on it

2.step 2 β†’ Now you use the ALT + Enter key to import.

Follow this link, it’s useful for you to find a shortcut for android studio:

http://javapapers.com/wp-content/uploads/2014/08/Android-Studio-Shortcuts-You-Need-the-Most.pdf

0
Dec 30 '15 at 6:52
source share



All Articles