Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut key to switch between XML layout and the java class in eclipse (android )

I'm not putting much hope in getting this problem solved, but this is really a pain and I really hope that this can be sorted out...

It is that, is there a shortcut key in Android Eclipse to switch between an xml layout file and its "related" java class (e.g. activity) source file? Much like Visual Studio's Windows Forms Designer (F7 to switch between design view and source code view).

I know that there is not a declarative definition on the relationship of an XML layout and an Activity/Fragment, it is determined during runtime... but still, it is an incredible pain when you are in the source code view and want to refer to a view by id but you (always) cannot remember the name, you need to scan through millions of files in millions of levels of tree depths in the Package Explorer view.

I feel like giving up even now... no one can help...

like image 702
im_chc Avatar asked Sep 19 '26 15:09

im_chc


1 Answers

No, because there isn't a 1:1 relationship between activities and layouts. One activity can have multiple layouts, and 1 layout can appear in multiple activities. I suggest you either adopt a naming standard so you don't have these problems, or just manually open the xml file and keep it open.

like image 150
Gabe Sechan Avatar answered Sep 21 '26 06:09

Gabe Sechan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!