9

In Eclipse we can correct indentation by pressing Ctrl + Shift + F.

How can I correct indentation (format code) in Android Studio?

Snostorp
  • 411
  • 5
  • 11
alanTuring
  • 93
  • 1
  • 3

3 Answers3

15

Select the code and press

  • On Windows: Ctrl + Alt + L
  • On MAC: CMD + Option + L
Suragch
  • 428,106
  • 278
  • 1,284
  • 1,317
Deadlock
  • 3,773
  • 1
  • 18
  • 24
3
File->settings->Keymap and select 'eclipse' from keymap dropdown.

By doing this all the shortcuts of eclipse will work in studio also

Ravi
  • 33,034
  • 19
  • 115
  • 176
3

File->settings->Keymap and select 'eclipse' from keymap dropdown.

Mohit Suthar
  • 8,135
  • 9
  • 33
  • 61