I cant find info on this anywhere. I am wondering about the significance of Structure tool in Android Studio. It shows me the class structure with all the methods. Is it showing me in what order the methods will get called when the code runs or are they sorted in some other way?
Is there a way to see in what order the methods will get called apart from setting breakpoints?
If you hover over the icons on the toolbar, you'll know what it does. It does not sort in the order of it being called.
It's basically a tool to help developers understand the structure of the file. It gives an overview of the methods at a glance for easy readablility.
Android Studio Structure工具顺序
InnerClass -> Interface -> Method -> Field
You are looking for sequence diagrams . The Android Studio does not provide such tool, but there are external ones (eg Visual Paradigm ) that can generate sequence diagrams from Java code, so you can see the execution order of methods.
By the way, the ordering you see in the Structure panel can order the fields / methods in multiple ways (you can even combine them):
Worth mentioning that methods appear before fields no matter what.
Note that what you're doing is reverse engineering, which is usually bad practice. A proper way would be that you first plan your class (and application) using class and sequence diagrams among others, then implement the solution.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.