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.
Use 'Related Symbol' (Navigate -> Related Symbol...) In windows, press ctrl+alt+home, you can switch between activity/fragment and corresponding layout file
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 you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With