Suppose that I am in a layout file named "main.xml" and its corresponding fragment java class is "MainFragment.java".
Is there any shortcut to go to "MainFragment.java" from the "main.xml" or any other way?
It will be helpful to navigate around xml and java classes quickly when there are a lot of java classes and xml files in the project.
Note: For activity, there is a “C” symbol found in the top-left corner of the layout XML file. When we click that "C" symbol it will take us to corresponding java class in which the xml file is used. But for fragments, there is nothing available.
使用'Related Symbol' (Navigate -> Related Symbol...) 在windows下,按ctrl+alt+home,可以在activity/fragment和对应的布局文件之间切换
You could right click on the file main.xml
and in the options menu click Find Usages
. You can then see all the places where main.xml
is used.
If I understand your question then you must be looking for short-cut keys for navigating around all *.java and *.xml files in Android Studio IDE editor.
Here are few short-cut keys I use on regular basis which might help you out!
Hope it would help you out!
Cheers!
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.