I'm new to Android Studio, and have ran into an issue where I paste in a code from a web tutorial into a project, fix imports, and still have every single line having some leading whitespace which the Android Studio recognizes as "Unexpected Token". After manually selecting the offending whitespace and deleting it, the errors disappear.
I tried Option + command + L shortcut for code formatting, but that did not fix the issue
How can I fix "Unexpected Token" error for code pasted into a .java file in Android Studio?