How to show line numbers in Android Studio [duplicate]

I'm posting a quick reference for "How can I show line numbers in Android Studio?" See answer below.

NOTE: This question has been marked as a duplicate because Android Studio is based on IntelliJ. In future, if you have a similar question, it's probably worth looking for the IntelliJ setting.


Solution 1:

In Windows

1.Press Ctrl+Shift+A

enter image description here 2.Input following string: "show line numbers"

enter image description here And you will see the setting, this method can find all the settings easily!

MAC

1.Press Command+Shift+A 2.Input following string: "show line numbers"

and following same flow of android studio.

Solution 2:

It's simple. Just Right click in left side of Workspace area and choose Show line number.

enter image description here

Solution 3:

  1. Go to File > Settings
  2. In the dialog, select 'Editor', then the sub-option for 'General', and then the sub-option for 'Appearance'.
  3. Select 'Show line numbers' as shown below.
  4. Click Ok.

enter image description here

Source

UPDATE The location for this setting has been changed to Editor -> General -> Appearance.