title: Cannot Resolve ContextCompat in Android
body: <p>I have an AlertDialogue object called dialog. I am attempting to add an icon to it. I see that this syntax is now deprecated:</p>
  
  <pre><code>dialog.setIcon(getResources().getDrawable(R.drawable.myImage);
  </code></pre>
  
  <p>I'm reading everywhere that this should work:</p>
  
  <pre><code>dialog.setIcon(ContextCompat.getDrawable(context, R.drawable.myImage));
  </code></pre>
  
  <p>However, the ContextCompat syntax is not being recognized by Android Studio. Is there something that I should be importing? Thank you.</p>
  
  <p>***Update: Thank's to @Sharj for the correct answer below. I made a quick video too if you guys need a visual: <a href="https://www.youtube.com/watch?v=eFiaO0srQro&amp;feature=youtu.be" rel="noreferrer">https://www.youtube.com/watch?v=eFiaO0srQro&amp;feature=youtu.be</a></p>