Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to assign a hotkey to switch between Activity and XML layout in Android Studio?

Android Studio shows this button in the top left when an activity is open, which jumps to the corresponding activity layout when clicked:

enter image description here

Is it possible to assign a hotkey to this button? I've looked through the keymap page in the Preferences, but can't find anything for this button.

like image 788
eliasbagley Avatar asked Mar 13 '16 04:03

eliasbagley


People also ask

How can use multiple layouts in one activity in Android?

You can use as many layouts as possible for a single activity but obviously not simultaneously. You can use something like: if (Case_A) setContentView(R. layout.

How many layout xml files can be associated with an activity?

You can not provide more than one layout to any activity, but if you want to use the different layout files in one activity than you can include all layout files into a single layout file using tag and use them in you activity.

Is it possible to include one layout definition in another?

To efficiently re-use complete layouts, you can use the <include/> and <merge/> tags to embed another layout inside the current layout. Reusing layouts is particularly powerful as it allows you to create reusable complex layouts.


2 Answers

You can add or confirm keyboard shortcuts at Keymap

Navigate > Related Symbol

like image 138
myoungjin Avatar answered Nov 08 '22 23:11

myoungjin


We can go related XML file from a class by pressing keyboard shortcut

Clr + Alt + Home 
like image 41
Shihab Uddin Avatar answered Nov 09 '22 00:11

Shihab Uddin