Play Turn Androidstudioide

Source: Internet
Author: User

1. Print the log:

LOGT, enter: auto generate static tag:

privatestaticfinal"MainActivity";

LOGD Enter
Loge Enter
Automatically generate print log

If you want to print parameters: Logm Enter

Auto Import Package: The package will not be imported automatically when you enter it, you need to set it up:

Under the setting:

2. Common shortcut keys

Code hint shortcut:ctrl+alt+ space

Move up and down one line of code:Ctrl+shift+up/down

Copy one line of code:ctrl+d

Delete one line of code:ctrl+y

Quick move between methods:Alt+up/down

Quickly select one or more lines of code:ctrl+w (try multiple times)

This is enough to write code.

Quick Find Open a class:Ctrl + N

Quickly find a file (such as XML):ctrl+shift+n

To quickly find a method in a class:ctrl+shift+alt+n

Show all methods in a class (fast switching method):ctrl+f12////////////

To view the parent class of a class:ctrl+u

See where a method is called: in the implementation of the method:ctrl+alt+h

See the implementation of a method (before you know it):ctrl+shift+i

Show class structure diagram:ctrl+h

Code return shortcut key:ctrl+alt+left

Switch between multiple windows:alt+left/right//////////////

Code folding and unwinding:ctrl++/-/////////////

Collapse Expand left panel:alt+1///////////

Overwrite the parent class method:ctrl+o///////////

Fast locating curly braces (one method is long):ctrl+{/}/////////

Select a statement to quickly add statements such as If,for,try catch:ctrl+alt+t//////

3. Generate code automatically

A shortcut key:ctrl+j

Then we write something:

Like what:

1. Null Judgment: Ifn/inn:

Enter:

     if (data == null) {        }

2.for Loop: For

3.findviewbyid:fbc

4.setvisibility:visible

.setVisibility(View.VISIBLE);

5. Print Toast:toast

 Toast.makeText(MainActivity.this"", Toast.LENGTH_SHORT).show();

Summary: Ctrl+j is still very powerful, there are many features, to explore their own.

4. Code Lookup Replace formatting

Search:ctrl+f

Replacement:ctrl+r

Recent files:ctrl+e

format Code :ctrl+alt+l(as if and QQ lock repeat, turn off QQ or change QQ shortcut key)

5.Debug
    1. First you need to add a breakpoint.

    2. Run the program

    3. F8 Single Step

    4. F7 Entering method interior

    5. Skip to Next breakpoint:Shift+f8

    6. View variable information without modifying the source code, such as forgetting to add a log statement during the debug process, as follows:

But I want to see the value of I, you can right-click on the breakpoint:

After clicking More, add the output statement:

Then you can see the value of the console output I in one step, or it is very convenient.

7. Cancel breakpoint: Click on the breakpoint directly.

6. Summary

There are many shortcut keys, in the setting directory:

Play Turn Androidstudioide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.