title: How to create a circular ImageView in Android?
body: <p>How could I create a rounded <code>ImageView</code> in Android?</p>
  
  <p>I have tried the following code, but it's not working fine.</p>
  
  <p>Code:</p>
  
  <pre><code>Bitmap circleBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
  
  BitmapShader shader = new BitmapShader (bitmap,  TileMode.CLAMP, TileMode.CLAMP);
  Paint paint = new Paint();
  paint.setShader(shader);
  
  Canvas c = new Canvas(circleBitmap);
  c.drawCircle(bitmap.getWidth()/2, bitmap.getHeight()/2, bitmap.getWidth()/2, paint);
  
  imageView.setImageBitmap(circleBitmap);
  </code></pre>
  
  <p>Image inside the circle:</p>
  
  <p><img src="https://i.stack.imgur.com/x8PhM.png" alt="Enter image description here"></p>
  
  <p>How can I do this?</p>