By default, line numbers are not shown in Android Studio editor. To show line numbers you just need to tweak the settings of Android Studio.
- Open Android Studio, click on File, choose Settings.
- Click on Editor, then on General and Appearance.
- Mark Show line numbers option and click the Apply button.
This way you can show line numbers in Android Studio.