title: How to convert LevelListDrawable into Bitmap or Icon
body: <p>I am getting this exception</p>
  
  <pre><code>java.lang.ClassCastException:
  android.graphics.drawable.LevelListDrawable cannot be cast to
  android.graphics.drawable.BitmapDrawable
  </code></pre>
  
  <p>getting exception at this line</p>
  
  <pre><code>Drawable d= getResources().getDrawable(R.drawable.kb, null);
  
  d.setLevel(3);   
  
  Bitmap bitmap = ((BitmapDrawable)d).getBitmap();
  </code></pre>