In Eclipse one can indent code by Ctrl+shift+F Unfortunately, this does not work in Android Studio.
Is there any opportunity doing this in Android-Studio?
In Eclipse one can indent code by Ctrl+shift+F Unfortunately, this does not work in Android Studio.
Is there any opportunity doing this in Android-Studio?
You have pretty much two options:
Change keymapping from Settings -> Keymap, and select Eclipse keymap
You can use the default which is CTRL + ALT + L
EDIT: people in the comments are suggesting that CTRL + ALT + WinKey+Lis the correct binding for Linux but the document of IDEA tells you that it's the same with Windows mapping: https://resources.jetbrains.com/assets/products/intellij-idea/IntelliJIDEA_ReferenceCard.pdf
EDIT #2: I sniffed some more info and found this answer https://askubuntu.com/a/412060. So after all you might get in trouble with the default keymapping when using, lets say Ubuntu, so watch out :)
On Mac, CMD + ALT + L will reformat your code for you in your current open file for both your Java files and XML files
On Windows I assume it will be CTRL + ALT + L
In your file do CTRL + A to select all the code and then CTRL + Alt + L (default shortcut) to re-indent all the code.