快捷键学习  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. NOIP 2008 立体图

    洛谷 P1058 立体图 洛谷传送门 JDOJ 1541: [NOIP2008]立体图 T4 JDOJ传送门 题目描述 小渊是个聪明的孩子,他经常会给周围的小朋友们将写自己认为有趣的内容.最近,他准备 ...

  2. POJ2536-Gopher II-(匈牙利算法)

    题意:n只老鼠,m个洞,s秒逃命,逃命速度为v,一个洞只能保住一只老鼠,最少多少只老鼠会被老鹰抓到. 题解:找出每只老鼠有哪些洞可以保命,建立二分图,算出最大匹配,不是求保住命的老鼠,而是求被抓住的老 ...

  3. Kinect一代学习(一):开发环境搭建

    https://blog.csdn.net/hongbin_xu/article/details/80722749 我用的是kinect一代(Xbox 360)的所以选择了v1.x的SDK,如果是ki ...

  4. 26 配置TensorFlow 1.9

    https://www.ctolib.com/topics-133854.html sudo apt install libatlas-base-dev pip3 install tensorflow ...

  5. ESA2GJK1DH1K基础篇: Android实现MQTT封装源码使用说明

    说明 这一节说明一下基础篇APP源码里面MyMqttCilent.java这个文件的使用 新建工程 安装MQTT的jar包 implementation 'org.eclipse.paho:org.e ...

  6. qbxt济南七日(游)学习

    七月的风八月的雨 卑微的我喜欢遥远的你 第七天: 更新 友谊的巨轮! 第六天: 我好饿 动态规划wcnm hhh, zkx坐在我旁边xswl 只要我和男生聊天 他就会把头探过来 用肯定的语气说: &q ...

  7. 【JZOJ100209】【20190705】狂妄之人

    题目 \(S\)串长为\(n\),字符集大小为\(k\) 一次操作为:取走\(S\)的任意一个字符或将\(S\)重排为一个没有出现过的字符\(S'\) 询问有多少个\(S\)使得后手必胜,答案对\(P ...

  8. c04--数组

    0.展示PTA总分 1.本章学习内容总结 1.1学习内容总结 数组查找: 1.遍历法查找:从头遍历数组找对应数据. 2.二分法查找:适用于按顺序排列的整形数组. 插入数据: 先找到该数据,对数组进行移 ...

  9. nginx 日志之 access_log分割

    如果任由访问日志写下去,日志文件会变得越来越大,甚至是写满磁盘. 所以,我们需要想办法把日志做切割,比如每天生成一个新的日志,旧的日志按规定时间删除即可. 实现日志切割可以通过写shell脚本或者系统 ...

  10. vue.config.js 配置 scss,less,sass全局配置 vuecli3

    module.exports = { /* 部署生产环境和开发环境下的URL:可对当前环境进行区分,baseUrl 从 Vue CLI 3.3 起已弃用,要使用publicPath */ public ...