title: C# - Resources.GetDrawable is obsolete in Android Xamarin
body: <p>I implemented <code>Resources.GetDrawable</code> in andrdoid Xamarin. The program works, but if I clicked the button implementing the <code>Resources.GetDrawable</code> the program force close. Here's my code:</p>
  
  <pre><code>SetContentView(Resource.Layout.Main);
  drawView = FindViewById&lt;DrawingView&gt;(Resource.Id.drawing);
  LinearLayout paintLayout = FindViewById&lt;LinearLayout&gt;(Resource.Id.paint_colors);
  currPaint = (ImageButton)paintLayout.GetChildAt(0);
  currPaint.SetImageDrawable(Resources.GetDrawable(Resource.Drawable.paint_pressed));
  </code></pre>
  
  <p>The <code>Resources.GetDrawable(Resource.Drawable.paint_pressed</code> got green underlined(Xamarin in Visual Studio 2015). The log message returned exception:</p>
  
  <blockquote>
    <p>Android.Content.Res.Resources+NotFoundException</p>
    
    <p>'Resources.GetDrawable(int)' is obsolete: 'deprecated'</p>
  </blockquote>
  
  <p>For Java version the solution is by using one of these 3:</p>
  
  <pre><code>ResourcesCompat.getDrawable(getResources(), R.drawable.name, null);
  //or
  ContextCompat.getDrawable(getActivity(), R.drawable.name);
  //or
  ResourcesCompat.getDrawable(getResources(), R.drawable.name, anotherTheme);
  </code></pre>
  
  <p>What is the version for C# Android Xamarin?, Thank you.</p>