快捷键学习  TIPS:

1.异常代码块  或者自定义代码块结构  Ctrl+Alt+T  或者   File | Settings | File and Code Templates

When you want to catch exceptions thrown by some code fragment, select it in the editor, press Ctrl+Alt+T (Code | Surround With) and choose try / catch. The catch blocks for all the exceptions thrown inside the block will be generated automatically.
You can customize the bodies of the generated catch blocks on the Code tab of File | Settings | File and Code Templates.
Use other items in the list to surround with other constructs

想抓住一些代码块抛出的异常的时候,选择中,Ctrl+Alt+T  或者右键  (Code | Surround With) and choose try / catch

自定义块有很多,比如if ...if...等

2.代码完成         and press Ctrl+Shift+空格:

The SmartType code completion may be used after the new keyword, to instantiate an object of the expected type. For example, type

说的是new一个对象的时候,使用快捷键         Ctrl+Shift+空格:

3.实现抽象方法   Ctrl+Alt+B

To navigate to the implementation(s) of an abstract method, position the caret at its usage or its name in the declaration and press Ctrl+Alt+B.

4. 提取变量进行重构,其实就是把一个很长的代码,缩减为几行,代码好看,并且把参数独立出来,重新申请一个变量,这样出错了容易找到是哪个问题    Ctrl+Alt+V

The Extract Variable refactoring helps you simplify complicated statements in your code. For example, in the code fragment below, you can select an expression in the code:

and press Ctrl+Alt+V (Refactor | Extract | Variable...). This will result in the following:

5.注释  跟ADT里面类似   Ctrl +斜杠 代表的意思是://   ;Ctrl + Shift +斜杠  代表的是  /*…*/

  

You can comment or uncomment lines and blocks of code using Ctrl+斜杠 and Ctrl+Shift+斜杠.
        Ctrl+斜杠 comments or uncomments the current line or selected block with single line comments (//...).
        Ctrl+Shift+斜杠 encloses the selected block in a block comment (/*...*/).
        To uncomment a commented block press Ctrl+Shift+斜杠 anywhere inside it.

6.

Ctrl+D in the editor duplicates the selected block or the current line when no block is selected.

7.制表符键

Use the Tab key to move between the template fields. See File | Settings | Live Templates for more details.

8.提示  变量名称  Ctrl+空格

The CodeCompletion feature can suggest a name for a variable when you declare it. For example, start typing

   private FileOutputStream

and press Ctrl+空格.

9.查看方法的 参数类型有哪些   Ctrl+P

If the cursor is between the parentheses of a method call, pressing Ctrl+P brings up a list of valid parameters.

10.代码回退  就是操作历史吧 Ctrl + Shift +退格键

Ctrl+Shift+Backspace (Navigate | Last Edit Location) brings you back to the last place where you made changes in the code.

Pressing Ctrl+Shift+Backspace a few times moves you deeper into your changes history.

11.使变量突出  Ctrl+Shift+F7

Use Ctrl+Shift+F7 (Edit | Find | Highlight Usages in File) to quickly highlight usages of some variable in the current file.
       Use F3 and Shift+F3 keys to navigate through highlighted usages.
       Press Esc to remove highlighting.

12.格式化代码  Code | Reformat Code

Use Code | Reformat Code to reformat code according to your code style preferences (File | Settings | Code Style).

You can also use Code | Optimize Imports to automatically optimize imports (remove unused imports, etc.). To access the corresponding settings, use File | Settings | Code Style | Imports.

13.回滚历史代码  Local History | Show History

To see your local history of changes in a file, invoke Local History | Show History from the context menu. You can navigate through different file versions, see the differences and roll back to any previous version.

Use the same context menu item to see the history of changes on a directory. You will never lose any code with this feature!

14.查看方法的申明 Alt+Q

Press Alt+Q (View | Context Info) to see the declaration of the current method without the need to scroll to it.

15.打开最近访问的文件  Ctrl+E (View | Recent Files)

Ctrl+E (View | Recent Files) brings a popup list of the recently visited files. Choose the desired file and press Enter to open it.

16.错误语法之间快速跳跃

Use F2/Shift+F2 keys to jump between highlighted syntax errors.

Use Ctrl+Alt+向上箭头/Ctrl+Alt+向下箭头 shortcuts to jump between compiler error messages or search operation results.

To skip warnings right click on the validation side bar / marker bar and choose Go to high priority problems only.

17.快速敲出变量名  Ctrl+J

Use Ctrl+J to complete any valid Live Template abbreviation if you don't remember it. For example, type it and press Ctrl+J to see what happens.

18.方法之间添加分隔符

To show separator lines between methods in the editor, open the editor settings and select the Show method separators check box in the Appearance page.

19.在两个方法之间快速的移动

Use Alt+向上箭头 and Alt+向下箭头 keys to quickly move between methods in the editor.

20.删除不必要的空格   Ctrl+Shift+J

Ctrl+Shift+J shortcut joins two lines into one and removes unnecessary space to match your code style.

21.构建一个类的副本

Use Refactor | Copy to create a class which is a copy of the selected class. This can be useful, for example, when you need to create a class which has much in common with some existing class and it's not feasible to put the shared functionality in a common superclass.

22.剪切和插入一段代码

Use the Ctrl+Shift+V shortcut to choose and insert recent clipboard contents into the text.

23.查看一个类的层级结构   层次结构  Ctrl+H

To see the inheritance hierarchy for a selected class, press Ctrl+H (Navigate | Type Hierarchy). You can also invoke the hierarchy view right from the editor to see the hierarchy for the currently edited class.

24.鼠标右键设置断点

Right-clicking on a breakpoint marker (on the bar to the left from the text) invokes the speedmenu where you can quickly enable/disable the breakpoint or adjust its properties.

25.调试的时候评估一个表达式的值

To easily evaluate the value of any expression while debugging the program, select its text in the editor (you may press a Ctrl+W a few times to efficiently perform this operation) and press Alt+F8.

26.查看定义说明  Ctrl+Q

The shortcuts such as Ctrl+Q (View | Quick Documentation), Ctrl+P (View | Parameter Info), Ctrl+B (Navigate | Declaration) and others can be used not only in the editor but in the code completion popup list as well.

27.更改内部类

When you invoke the Move refactoring (F6) on an inner class that is declared static, you are provided with an option to either make it a top-level class, or move it to another class.

28.打开任何一个变量或者方法  Ctrl+Alt+Shift+N

To open any particular method or field in the editor quickly, press Ctrl+Alt+Shift+N (Navigate | Symbol) and start typing its name.

Choose symbol from the drop-down list that appears.

29.快速回顾最近更改的项目

Use Alt+Shift+C to quickly review your recent changes to the project.

30.代码快速补充    Ctrl+空格

Use Basic Completion (Ctrl+空格) within HTML, CSS and other files, for completing image file names.

31.灯泡标识  提示  自动创建  变量,从而不用离开当前的编辑位置

You can start referring to an Ant property or target even if it is not defined yet. An intention action feature will suggest you to automatically create the necessary tag, without the need for you to leave your current editing location.

32.补齐  大括号{}  Ctrl+Shift+Enter

Use Ctrl+Shift+Enter to complete a current statement such as if, do-while, try-catch, return (or a method call) into a syntactically correct construct (e.g. add curly braces).

33.调试运行

By pressing Alt+Shift+F10 you can access the Run/Debug dropdown on the main toolbar, without the need to use your mouse.

34.重命名

It is possible to rename CSS selectors directly from HTML. Position the caret at the selector to be renamed and press Shift+F6 (Refactor | Rename).

35.显示文件home

Navigation bar is a quick alternative to the Project view.
       Use Alt+Home keyboard shortcut to show the navigation bar, and arrow keys to locate the necessary files or folders.

36.快速打开一个eclipse项目

You can quickly open an Eclipse project by selecting a .classpath or .project file in the File | Open dialog. The corresponding Eclipse project is imported with default settings, without launching the wizard.

37.快速找到一个类、方法、变量在整个项目中哪些地方被使用 Ctrl+Alt+F7

You can bring forward the list of all usages of a class, method or variable across the whole project, and quickly jump to the selected usage. To do that, place the caret at the symbol's name or at its usage in code and press

Ctrl+Alt+F7 (Edit | Find | Show Usages in the main menu), scroll the list and click the desired usage.

38.选择接口列表

You can view all methods of the implemented interfaces in a class, if you place the caret at the implements keyword in the class declaration, press Ctrl+Shift+F7, and select the desired interface from the list:

39.查看一个方法中  所有的退出点  Ctrl+Shift+F7

To view all exit points of a method, place the caret at one of them, e.g. the return statement, and press Ctrl+Shift+F7:

40.快速查看哪些代码会抛出异常

You can view all statements within the method where certain exceptions can be caught. Just place the caret at the throws keyword in a method declaration, press Ctrl+Shift+F7 and select the desired exception class from the list.

This will also work for try and catch.

41.创建测试用例

Android Studio helps create test cases directly from class declaration. With the caret at the class name in the editor, press Alt+Enter, and choose Create Test from the suggestion list:

42.

android studio学习---快捷键的更多相关文章

  1. Android Studio实用快捷键汇总

    以下是平时在Windwos系统上用Android Studio进行开发时常用到的一些快捷键,虽然不多,但是感觉都还蛮实用的,因此记录下来,如果什么时候不小心忘记了可以拿来翻一翻,That would ...

  2. Android Studio 学习 - 基本控件的使用;Intent初学

    Android Studio学习第三天. 今天主要学习 1. RadioButton.CheckBox.RatingBar.SeekBar等基础控件的使用. 结合Delphi中相类似的控件,在这些基本 ...

  3. android studio 更改快捷键为eclipse中习惯的方式

    虽然之前看了不少android studio的快捷键,但主要开发依然还是在eclipse上,仍然不习惯android studio的快捷键方式,今天看一视频说可以改快捷键为eclipse的方式,不由得 ...

  4. android studio的快捷键设置的和eclispe一样

    最近安装了android studio,但是习惯了使用eclispe的快捷键,所以我也把android studio的快捷键设置的和eclipse一样. 具体如下: 1.快捷键 Android Stu ...

  5. Android Studio 常用快捷键及常用设置

    Android Studio 常用快捷键及常用设置 一.常用快捷键 快捷键 描述 Ctrl + Alt + L 格式化代码 Ctrl + ( +/- ) 展开/折叠 代码块 Ctrl + Shift ...

  6. Android Studio 常用快捷键 for mac

    Android Studio 常用快捷键 for mac 查找/查看相关 ⌘O: 全局查找class类名<使用率非常高> ⌘F: 在当前编辑文件中查找<使用率非常高> | 对应 ...

  7. Android Studio常用快捷键 - 转

    Android Studio常用快捷键 1. Ctrl+D: 集合了复制和粘贴两个操作,如果有选中的部分就复制选中的部分,并在选中部分的后面粘贴出来,如果没有选中的部分,就复制光标所在的行,并在此行的 ...

  8. [Android Studio] Android Studio常用快捷键

    [Android Studio] Android Studio常用快捷键   (会持续更新)这边讲的常用快捷键是指做完Keymap到Eclipse后的,不是纯Android Studio的,这边主要讲 ...

  9. Android Studio常用快捷键、Android Studio快捷键大全

    Android Studio 是谷歌基于IntelliJ IDEA开发的安卓开发工具,有点类似 Eclipse ADT,Android Studio 提供了集成的 Android 开发工具用于开发和调 ...

随机推荐

  1. 小学四则运算口算练习app---No.5

    今天主要设置答案页面,主要是出题页面和答案页面之间的传参问题以及答案页面的展示问题!这里运用数组讲出的题目包装成一个String类型数目(包括等号和使用者的作答) 讲正确答案单独包装成一个数组,以及相 ...

  2. P1908 逆序对-(树状数组)

    https://www.luogu.org/problem/P1908 比较喜欢线段树,懒得用树状数组(只会套模板,位运算的精髓没有领悟到),一直没有记录树状数组代码,又得捡回来,趁这道题记录一下模板 ...

  3. 请指出document load和document ready的区别

    document load文档的所有内容都加载完成 document ready文档的DOM加载完成

  4. selenium--上传文件

    前戏 在进行web自动化的时候,经常需要用到上传文件的功能,selenium可以使用send_keys()来上传文件,但是使用send_keys()上传文件有很大的局限性,只能上传input标签的,好 ...

  5. Vue中的v-bind指令

    普通: property="value" 此时 value为字符串 v-bind指令 v-bind:property="value" 此时 value会被解析成 ...

  6. ZROI 暑期高端峰会 A班 Day5 计算几何

    内积(点积) 很普及组,不讲了. \[(a,b)^2\le(a,a)(b,b)\] 外积(叉积) 也很普及组,不讲了. 旋转 对于矩阵 \(\begin{bmatrix}\cos\theta\\\si ...

  7. ES6基础-ES6的扩展

    进行对字符串扩展,正则扩展,数值扩展,函数扩展,对象扩展,数组扩展. 开发环境准备: 编辑器(VS Code, Atom,Sublime)或者IDE(Webstorm) 浏览器最新的Chrome 字符 ...

  8. haproxy 配置文件详解 之 ACL 智能负载均衡

    由于HAProxy 可以工作在七层模型下, 因此,要实现 HAProxy 的强大功能,一定要使用强大灵活的ACL 规则,通过ACL 规则可以实现基于HAProxy 的智能负载均衡系统. HAProxy ...

  9. 第01组 Alpha事后诸葛亮

    目录 一.总结思考 1.设想和目标 ①我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描述? ②我们达到目标了么(原计划的功能做到了几个? 按照原计划交付时间交付了么? 原 ...

  10. [Gamma]Scrum Meeting#10

    github 本次会议项目由PM召开,时间为6月5日晚上10点30分 时长15分钟 任务表格 人员 昨日工作 下一步工作 木鬼 撰写博客,组织例会 撰写博客,组织例会 swoip 前端显示屏幕,翻译坐 ...