如何通过快捷方式导航到 Android Studio 中的错误行?

如何导航到 java 文件中的错误行?

没有比滚动条更好的方法了吗?

26074 次浏览

I searched for it and found the answer.

1- you can use F2 and SHIFT+F2 shortcut to navigate between errors in your document. if there is no error you will be navigated to the warnings.

2- another way that most of us know is to click on the red areas on the scrollbar.

here is the the link to the intelliJ IDEA help documents which is the base of Android Studio.

you can even press F2 in project window of Android Studio and it will select the files containing errors.

Also if there are no more errors it will point to warnings.

I have another approach, Make Project by press(Ctrl-F9), you can find the errors in Gradle Console(if error exists), just click the red messages will bring you to the error of line directly.

F2 is shortcut key to jump on next error line in java file. SHIFT+F2 shortcut to navigate between errors in your document. if there is no error you will be navigated to the warnings.

None of the above solutions worked for me.

A work-around in windows I use is ALT+N+N (Menu ➔ N̲avigate ➔ N̲ext Highlighted Error).

You can also assign a shortcut for Next Highlighted Error in Keymap.

You can use below shortcuts for compilation errors:

  • Moving to next / previous highlighted error: F2/Shift + F2

  • Show descriptions of error at caret: Ctrl + F1