Use Android Studio's quick fix feature.
When there's a red line under any code in Android Studio, it means that there's an error. To resolve the error, click on the code with the error, and press
Ctrl+Enter. This will provide you with multiple options for fixing the error. I use it all day long!
Ctrl+Shift+Aallows you to type any command available in the Android Studio menus. For example, type