title: getDrawable(int id) is deprecated. How can I set an image?
body: <p>Have a question! getDrawable() is deprecated in API 22. So, if I make an app with the min API 16, how can I set an image?</p>
  
  <p>I saw that I can use  getDrawable(int id, theme) , but this was added in API 21, so I can't use it.</p>
  
  <p>I've tried <code>setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.drawableName, null))</code> but this doesn't work either. Also with ContextCompat or getApplicationContext() it doesn't work.</p>
  
  <pre><code>private ImageView weatherIcon;
  weatherIcon=(ImageView)findViewById(R.id.weatherIcon);
  if(weatherReportList.size()&gt;0){
              DailyWeatherReport report=weatherReportList.get(0);
              switch (report.getWeather()){
                  case DailyWeatherReport.WEATHER_TYPE_CLOUDS:
                      weatherIcon.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.cloudy, null));
                      weatherIconMini.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.cloudy, null));
                  case DailyWeatherReport.WEATHER_TYPE_RAIN:
                      weatherIcon.setImageDrawable(ContextCompat.getDrawable(this,R.drawable.rainy));
                      weatherIconMini.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.rainy, null));
  
                  default:
                      weatherIcon.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.sunny, null));
                      weatherIconMini.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.sunny, null));
  
  
              }
  </code></pre>
  
  <p>This is not a duplicate of that post. I've tried all the methods from there but none on them worked.</p>