Android Studio shortcuts like Eclipse

I am new to Android Studio and want to know about shortcuts. In Eclipse we use shift-ctrl-O for importing. In Android Studio we use alt-enter. My question about importing override methods and unimplemented methods. Is there a shortcut for these in Android Studio?

122968 次浏览

Alt+enter is a 'fast solving problems option'. If you try it over class name after writing 'implements XXXX' it will suggest you to autoimplemnt that methods.

The correct shortcut for 'Organice imports' is Ctrl+Alt+O

You can find a really good Android Studio/IntellyJ shortcuts cheatsheet here: IntellyJ shortcut cheatsheet

------Hint-----

Give a try to Live Templates in Android Studio (It's like magic). Just press Ctrl+J

You can change your keymap to use eclipse shortcuts. You can see here how to change keymap. https://stackoverflow.com/a/25419358

These are for shortcuts specific to android studio.And since it is based on IntelliJ Idea studio,these will work too

answering your specific question,Android Studion is quite logical wrt to shortcuts,for eg for all the situations you asked,try alt-insert

Yes, the list of keyboard shortcuts for Android Studio is at https://developer.android.com/studio/intro/keyboard-shortcuts.html.

Here are a few that I know.

Check :File ->Settings ->Keymap -> <Choose Eclipse from Keymaps dropdown> or

Add unimplemented methods: CTRL + I

Override methods: CTRL + O

Format code: CTRL + ALT + L

Show project: ALT + 1

Show logcat: ALT + 6

Hide project - logcat: SHIFT + ESC

Build: CTRL + F9

Build and Run: CTRL + F10

Expand all: CTRL + SHIFT + NumPad +

Collapse all: CTRL + SHIFT + NumPad -

Find and replace: CTRL + R

Find: CTRL + F

In case I'm missing any shortcut that you need you can ask here and for more check implink!! or link!!:)

Yes you can go to File -> Settings -> Editor -> Auto Import -> Java and make the following changes:

1.change Insert imports on paste value to All in drop down option.

2.markAdd unambigious imports on the fly option as checked.(For Window or linux user)

On a Mac, do the same thing in Android Studio -> Preferences

3.You can also use Eclipse shortcut key in Android Studio just go to in Android Studio

File -> Settings -> KeyMap -> Keymaps dropdown Option. Select from them

Thankyou

you can not remember all shortcuts :)
android studio(actually intellij) has a solution

quick command search : ctrl+shift+A

enter image description here

You can use Eclipse Short-cut key in Android Studio too.

File -> Settings -> Keymap -> <Choose Eclipse from Keymaps dropdown>

For Mac OS :

Android Studio -> Preferences or Properties -> Keymap -> <Choose Eclipse from Keymaps dropdown>

Another option is :

View  >  Quick Switch Scheme  >  Keymap  >  Eclipse

View > Quick Switch Scheme > Keymap > Eclipse
use this option for eclipse keymap or if u want to go with AndroidStudio keymap then follow below link

Click here for Official Android Studio Keymap Refference guide

you may find default keymap referrence in

AndroidStudio --> Help-->Default keymap refrence

If you use Android Studio with Mac OS X these are some shortcuts:

- Compile java sources SHF+CMD+F9

- Build the project CMD+F9

- Run the current configuration CTR+R

- Run in debugger CTR+D

- Open project properties CMD++;

- Open Android Studio preferences CMD++,

- Find any command SHF+CMD+A

- Auto-format code OPT+CMD+L

- Delete line CMD+DELETE or CMD+Backspace

- Duplicate line/selection CMD+D

- Copy line CMD+C (with nothing selected)

- Select next occurance(s) CTR+G

Scope based selection

  • Select next higher scope Option+UP

  • Select next lower scope Option+DOWN

enter image description here

Navigating the code

- Open class CMD+O

- Open file SHF+CMD+O

- Navigate back to last position CMD+[

- Navigate forward to previous position CMD+]

- Switch to recently used files CRT+TAB

Intention Actions

  • If/Switch actions Option+RETURN

enter image description here

Create method CMD+N

or

enter image description here

Loop an array of ints

enter image description here

  • Generate Logs usin logd, loge, logi, logt, logm and logr

enter image description here

- Project quick fix ALT+ENTER

- Show docs for selected API F1

- Jump to source CMD+down-arrow

Most of them I found on this really good article and Android Studio Tips and Tricks

These are some of the useful shortcuts for Android studio (Windows)

  • Double Shift - Search EveryWhere

  • Ctrl + Shift+A - quick command search

  • Ctrl +N - Find Class (capable of finding internall classes aswell)

  • Ctrl +Shift+N - Find File

  • Alt+F7 - Find Uses (To get the call hierarchy)

  • Ctrl+B - goto class definition.

  • Ctrl+LeftClick - goto to symbol(variable, method, class) definition/definition.

  • Ctrl+Alt+Left - Back

  • Ctrl+Alt+Right - Right

  • Shift+f6 - Refactor/Rename

Not eclipse like you can do eclipse shot cuts just do the following

File ->Settings ->keymap -> in the drop down "KeyMaps" select  Eclipse ->
Apply ->ok.

Android Studio is built on IntelliJ IDEA Community Edition, the popular Java IDE by JetBrains. This allows the user to select their own keymap (supporting different IDE shortcuts in your IDE).

You can use "Mac os X, Visual studio, Eclipse, Netbeans etc.. shortcuts in your Android Studio by doing the following:

File -> Settings -> Keymap -> choose "Eclipse" from dropdown.

OR press Ctrl+Alt+S -> keymap -> choose "Eclipse" from dropdown like this.

enter image description here

Update

From Android Studio v3.0.1:

In Android Studio, by pressing ALT + INSERT (or + N for MacOS), you will have following choices (including your solution!):

  • Constructor
  • Getter
  • Setter
  • Getter and Setter
  • equals() and hashCode()
  • toString()
  • Override Methods...
  • Implement Methods...
  • Delegate Methods...
  • Super Method Call (When inside an Override Method)
  • Copyright
  • App Indexing API Code (Not available inside class extending Fragment.)

Note: Some methods are auto implemented but you can select Override Methods... option to implement other unimplemented methods.

Important Android Studio Shortcuts You Need the Most


Navigation Shortcuts

  • Go to class : CTRL + N

  • Go to file : CTRL + SHIFT + N

  • Navigate open tabs : ALT + Left-Arrow; ALT + Right-Arrow

  • Lookup recent files : CTRL + E

  • Go to line : CTRL + G

  • Navigate to last edit location : CTRL + SHIFT + BACKSPACE

  • Go to declaration : CTRL + B

  • Go to implementation : CTRL + ALT + B

  • Go to source : F4

  • Go to super Class : CTRL + U

  • Show Call hierarchy : CTRL + ALT + H

  • Search in path/project : CTRL + SHIFT + F


Programming Shortcuts

  • Reformat code : CTRL + ALT + L

  • Optimize imports : CTRL + ALT + O

  • Code Completion : CTRL + SPACE

  • Issue quick fix : ALT + ENTER

  • Surround code block : CTRL + ALT + T

  • Rename and refactor : SHIFT + F6

  • Line Comment or Uncomment : CTRL + /

  • Block Comment or Uncomment : CTRL + SHIFT + /

  • Go to previous/next method : ALT + UP/DOWN

  • Show parameters for method : CTRL + P

  • Quick documentation lookup : CTRL + Q


General Shortcuts

  • Delete line : CTRL + Y

  • Safe Delete : ALT + DELETE

  • Close Active Tab : CTRL + F4

  • Build and run : SHIFT + F10

  • Build : CTRL + F9

  • All purpose (Meta)Shortcut : CTRL + SHIFT + A

Using Eclipse key mapping inside Android Studio is the better choice. It will easily adapt to existing key structure. But all the new persons are using new shortcut key structures in Android Studio has. So we will learn and follow Android Studio itself contain shortcuts will help easily interact the team mates.

If you use Android Studio in Max OS X mean to follow the below link. It works for me. https://stackoverflow.com/a/30891985/2219406

in androidstudio 3.0(>=) in menu bar go to help-> keymap Reference It will give all the shortcuts .. link

保存所有 Control + S Command + S

同步控制 + Alt + Y 命令 + 选项 + Y

最大化/最小化编辑器控件 + Shift + F12控件 + Command + F12

添加到收藏夹 Alt + Shift + F 选项 + Shift + F

使用当前配置文件 Alt + Shift + I 选项 + Shift + I 检查当前文件

快速切换方案控制 + (backquote) Control +(反引号)

打开设置对话框 Control + Alt + S Command + ,(逗号)

打开项目结构对话框 Control + Alt + Shift + S Command + ; (分号)

在选项卡和工具窗口之间切换控件 + 选项卡控件 + 选项卡

在 Studio 中导航和搜索

搜索一切(包括代码和菜单)按 Shift 两次按 Shift 两次

查找控制 + 命令 + F

查找下一个 F3命令 + G

查找上一个 Shift + F3命令 + Shift + G

替换 Control + R Command + R

查找动作控制 + Shift + 命令 + Shift + A

按符号名称 Control + Alt + Shift + N Command + Option + O 进行搜索

查找类 Control + N Command + O

查找文件(代替类)控制 + Shift + N 命令 + Shift + O

在路径中查找控制 + Shift + F 命令 + Shift + F

打开文件结构弹出控件 + F12命令 + F12

在打开的编辑器选项卡 Alt + 右/左箭头控件 + 右/左箭头之间导航

跳转到源 F4/Control + 输入 F4/Command + 向下箭头

在新窗口 Shift + F4 Shift + F4中打开当前编辑器选项卡

最近打开的文件弹出控制 + E 命令 + E

最近编辑的文件弹出控件 + Shift + E 命令 + Shift + E

转到最后一个编辑位置 Control + Shift + Backspace Command + Shift + Backspace

关闭活动编辑器选项卡 Control + F4 Command + W

从工具窗口返回到编辑器窗口

隐藏活动或最后一个活动工具窗口 Shift + Esc Shift + Esc

转到行 Control + G Command + L

开放式层次结构控制 + H 控制 + H

控制 + Shift + H 命令 + Shift + H

开放调用层次结构 Control + Alt + H Control + Option + H

写代码

生成代码(getters、 setter、构造函数、 hashCode/equals、 toString、 new file、 new 类) Alt + Insert Command + N

控制 + O 控制 + O

实现方法

用(if... else/try... catch/etc) Control + Alt + T Command + Option + T 环绕

删除插入符号控制 + Y 命令 + 退格

崩溃/展开当前代码块 Control + 减号/加号 Command + 减号/加号 折叠/展开所有代码块 Control + Shift + 减去/加 Command + Shift +

负/正

复制当前行或选择 Control + D Command + D

基本代码完成控制 + 空间控制 + 空间

智能代码完成(按预期类型筛选方法和变量列表)
控制 + 移位 + 空间控制 + 移位 + 空间

完成语句 Control + Shift + Enter Command + Shift + Enter

快速文档查找控件 + Q 控件 + J

显示所选方法的参数 Control + P Command + P

转到声明(直接) Control + B 或 Control + 单击 Command + B 或 Command + 咔嚓

转到实现控制 + Alt + B 命令 + Alt + B

转到超级方法/超级类 Control + U Command + U

打开快速定义查找控件 + Shift + I 命令 + Y

切换项目工具窗口可见性 Alt + 1 Command + 1

切换书签 F11 F3

用助记符控件 + F11选项 + F3切换书签

使用行注释来注释/取消注释 Control +/Command +/

使用块注释注释/取消注释控制 + Shift +/命令 + Shift +/

选择相继增加的代码块 Control + W Option + Up

减少当前选择到以前的状态控制 + 移位 + W 选项 + 下

移动到代码块 start Control + [ Option + Command + [

移动到代码块结束控制 + ]选项 + 命令 + ]

选择代码块开始控制 + Shift + [选项 + 命令 + Shift + [

选择代码块结尾的 Control + Shift + ]选项 + Command + Shift + ]

删除到词尾控制 + 删除选项 + 删除

删除开头的单词 Control + Backspace Option + Backspace

优化进口控制 + Alt + O 控制 + 选项 + O

项目快速修复(显示意图动作和快速修复) Alt + Enter Option + Enter

重新格式化代码控制 + Alt + L 命令 + 选项 + L

自动缩进线控制 + Alt + I 控制 + 选项 + I

缩进/取消缩进行 Tab/Shift + Tab/Shift + Tab

智能线连接控制 + Shift + J 控制 + Shift + J

智能行分割控制 + 输入命令 + 输入

开始新行 Shift + Enter Shift + Enter

下一个/上一个突出显示的错误 F2/Shift + F2 F2/Shift + F2

构建并运行

构建控件 + F9命令 + F9

构建并运行 Shift + F10 Control + R

应用更改(即时运行)控件 + F10控件 + 命令 + R

正在调试

调试 Shift + F9控件 + D

跨过 F8 F8

进入 F7F7

巧妙地进入 Shift + F7 Shift + F7

走出档位 + F8档位 + F8档位

运行到光标 Alt + F9选项 + F9

计算表达式 Alt + F8选项 + F8

恢复程序 F9命令 + 选项 + R

切换断点控制 + F8命令 + F8

查看断点控制 + Shift + F8命令 + Shift + F8

重构

收到 F5F5

移动 F6F6

安全删除 Alt + 删除命令 + 删除

重命名 Shift + F6 Shift + F6

更改签名控制 + F6命令 + F6

内联控制 + Alt + N 命令 + 选项 + N

提取方法 Control + Alt + M Command + Option + M

提取变量控制 + Alt + V 命令 + 选项 + V

提取字段控制 + Alt + F 命令 + 选项 + F

提取常量控制 + Alt + C 命令 + 选项 + C

提取参数 Control + Alt + P Command + Option + P

版本控制/本地历史记录

将项目提交到 VCS 控制 + K 命令 + K

从 VCS 控制 + T 命令 + T 更新项目

查看最近的更改 Alt + Shift + C 选项 + Shift + C

打开 VCS 弹出窗口 Alt + ‘(反引号) Control + V

如果您正在 Android 工作室中寻找快捷方式,但不太记得该命令,只需单击 Ctrl + Shift + A启动命令搜索。从这里,你可以搜索任何你想要的捷径。

编程快乐!

搜索

enter image description here

  • All-到处搜索

    Shift

  • Classes-查找类:

    Mac: ⌘ Command + O
    Windows/Linux: Ctrl + N < br/>

  • Files-查找文件:

    Mac: ⌘ Command + Shift + O
    Windows/Linux: Ctrl + Shift + N < br/>

  • Symbols-按符号名称搜索:

    Mac: ⌘ Command + ⌥ Option + O
    Windows/Linux: Ctrl + Alt + Shift + N

  • Action-寻找行动:

    Mac: ⌘ Command + Shift + A
    Windows/Linux: Ctrl + Shift + A