Create rounded imageview in Android

There is a simple way to create rounded image view in Android. We can use a CardView and ImageView together for this. See the below code

<android.support.v7.widget.CardView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:cardCornerRadius="50dp"
    app:cardPreventCornerOverlap="true">

    <ImageView
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:src="@drawable/profile_image" />

</android.support.v7.widget.CardView>

Use the app:cardCornerRadius value exactly half of the image.

rounded_imageview_android
This is how it looks like

Thank you.