[Android Studio] Viewing inheritance relationships for classes in Android Studio

Source: Internet
Author: User

Reprinted from: http://blog.csdn.net/hyr83960944/article/details/38098091

View the shortcut keys for the inheritance relationship of a class F4, which is commonly used in Android studio Shortcuts , has been written in this article. Today is mainly about this shortcut key out of the interface of some configuration, this function is relatively cold some, probably a lot of people will not be able to use. However, many of these configurations are similar in Android studio.

Needless to say, direct, such as, I selected activity, and then press F4, on the right there will be a diagram with the activity has an inheritance relationship.

1, the first brief analysis of several elements:

Note: The number of icons in this section is from left to right.

First icon: Shows all inheritance relationships, including parent class, subclass

Second icon: Show parent class

Third icon: Show sub-class

The fourth icon: alphabetical order, this is not very useful, we do not care

Scope: This is the scope, that is, you want to query which scope of the inheritance relationship, the following drop-down box is to select the scope you want.

I won't say the next few icons, it's not too much.

Again, there are two types of class icons that are queried for inheritance relationships:

No small gray Lock: class in the current project


2. Scope Brief Analysis:

Explanation before the point, here so-called do not show the source of the class, are down, not up, for example, I look at the activity of the inheritance, if you choose the scope for not showing the scope of the source code, only refers to the activity of the source code of the sub -class does not display, if still do not understand, Look at the instructions below production.

Production: In fact, is the query scope of the current project, this time will hide the inheritance activity of non-project classes, such as listactivity.

All: This is a good understanding, including the project and the source code

Test: This is, in a sense, the same as this class.

This class: Current classes

Configure: Configure the range of queries you want to set yourself.

The default option is the above few, as for Local,share I added.

For example, I chose production, such as, you will only see myactivity, my Code also has inherited MyActivity class, so myactivity front has an arrow, but I did not expand.


Re-select MyActivity, then press F4, bring up the inheritance graph, select the second icon, and then the range to choose the current class, and you can see the parent class of myactivity.


Select the third icon, and this time you will only see the myactivity subclass.

It is estimated that some people may say that I am not good when they use it because you have a problem with the scope, you must pay attention to the scope of your choice.


3, the next major point of configure after how to configure

1) Icon and area function analysis

First add scope through configure, I added the local and share two, in fact you can add the type is two, either local or share, the name you can take the ha. My side is easy to explain so just name it by type.

Share with a small white arrow, local no, very well differentiated.

First icon: Add a scope

Third icon: Copy a scope, here is a full copy except name, name defaults to unnamed

The fourth icon: Save your selected scope as, there is a time when you may be a little bit, this is the bug of Android Studio, you turn off the dialog box, re-configure general can be done.

The fifth to Sixth icon: Change position icon, for example you can move local to share above.

Pattern: Range Matching (this piece of content will be spoken along with the four buttons on the right)

The pattern below has a row of selectable content, which is actually the choice of your project and the reference package in what way to display, if you think this piece is too chaotic, not to see. You choose a different way, the following production classes and the library classes will be displayed according to the way you choose to display.

Include,exclude: The two are relative, one added, one removed, all for pattern, here is the addition of the package-level content removal

Include Recursively,exclude recursively: These two are also relative, adding and removing pattern content, here is the addition and removal of content at the class level

You can also edit the pattern directly by clicking the White button at the back of the pattern.


2) configuration parameters

With share selected, and copy, you can see that there is a unnamed in the scope,unnamed pattern content is the same as share, I set the share pattern to myactivity class:


Set the local pattern to com.example.myapp.* in this package


Configuration complete, click OK, back to the Inheritance relationship page, we look at the effect, select Share, you will see this time myactivity subclass Bactivity will not be queried, because not in the query scope.


Select Local,local Range is the entire package, this time you can see bactivity also be queried out

Related Article

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.