View the class inheritance relationship in Android Studio

Source: Internet
Author: User

View the class inheritance relationship in Android Studio

The F4. this article describes the shortcut key for viewing the inheritance relationship of a class. Today, I am mainly talking about some configurations on the interface provided by this shortcut key. This feature is relatively cold and may not be used by many people. However, many android studio has similar configurations.

Not to mention nonsense. For example, if I select Activity and press F4. a diagram with an inheritance relationship with Activity appears on the right.

1. briefly analyze the following elements:

Note: The number of icons is calculated from left to right.

The first icon: displays all inheritance relationships, including parent and child classes.

Second icon: displays the parent class

Third icon: Show subclass

Fourth icon: sort by letter. This is of little use and you don't have to worry about it.

Scope: This is the range, that is, the inheritance relationship in which you want to query, and the drop-down box below is to select the range you want.

I will not talk about the following icons, and the relationship is not very big.

In addition, there are two types of inherited class icons:

Small gray lock icon: Class in source code

Without a small gray lock: Class in the current project


2. Brief Analysis of Scope: <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + release/L + c69tcSyu8/release/yyc + jrL7ZuPbA/release + zcrHsPzAqLG + release + bXEoaM8L3A + release/ uvs3Kx9LUyc + 8uLj2o6zWwdPabG9jYWyjrHNoYXJlysfO0tfUvLrM7bzTtcShozwvcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140725/2014072509160735.png" alt = "\">

For example, if I select Production, for example, you will only see MyActivity, and my code contains classes that inherit from MyActivity, so there is an arrow in front of MyActivity, But I didn't expand it.


Re-select MyActivity, then press F4 to bring up the inheritance relationship diagram, select the second icon, and select the current class in the range. You can see the parent class of MyActivity.


Select the third icon. At this time, you can only see the subclass of MyActivity.

It is estimated that some people may say how I do not work when using it. It is because your Scope has a problem and you must pay attention to the Scope you choose.

Seo6yb6z/examples/samples/Ltc/C09DKsbryxOO/ycTcu + samples/samples + UGF0dGVybs/Cw + bT0NK7xcW/samples + samples/samples + examples/examples/Uyr6hozwvcD4KPHA + examples/08L3A + examples/TwvcD4KPHA + examples/ydLUzai5/bXju/examples + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140725/2014072509160741.jpg" alt = "\">

2) configuration parameters

Select share and copy. You can see that there is an Unnamed Scope. The Pattern content in Unnamed is the same as that in share. I will set the Pattern of share to the MyActivity class:


Set the Pattern of local to com. example. myapp. *.


After the configuration is complete, click OK and return to the inheritance relationship page. Let's take a look at the effect and select share. You will see that the subclass BActivity of MyActivity will not be queried at this time because it is not within the query range.


Select local. The range of local is the entire package. You can see that BActivity is also queried.


OK. Let's talk about this today. The next article will introduce how to use Gradle to build a project.

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.