In Android Studio, code in my MainActivity suddenly started showing all kinds of errors (red underlines all over the place). But the code is fine. It compiles and runs without problems. This just started happening all of a sudden. The highlighted errors all seem to be related to the context of the activity. For example:
Context context = this;
findViewById
registerReceiver
I cleared the cache and restarted Android Studio but this didn't help. I also tried deleted all the files in the build directories.