Android Studio cannot resolve method getBaseContext(), but it used to work
<p>In my app I'm using Toasts as </p>

<pre><code>Toast.makeText(getBaseContext(), "Updating...", Toast.LENGTH_SHORT).show();
</code></pre>

<p>Which has worked fine until now. Now I all of a sudden get the following error for all of my toasts.</p>

<blockquote>
  <p>Cannot resolve method <code>getBaseContext()</code></p>
</blockquote>

<p>I found <a href="https://stackoverflow.com/questions/27571590/cannot-resolve-getbasecontext-in-android"> this </a> question on here, which was solved by having the class extend <code>ActionBarActivity</code>. 
The class my toasts are in is the <code>MainActivity.java</code> and extends <code>AppCompatActivity</code>, and implements <code>View.OnTouchListener</code>. I doubt it has anything to do with this, since the class is extending an <code>Activity</code> anyhow. </p>

<p>I have tried cleaning and rebuilding the project several times. Also, I've done an "Invalidate Caches / Restart..." </p>