Create a Drawable XML file
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<solid android:color="@android:color/white" />
<stroke
android:width="1dp"
android:color="@color/md_white_1000" />
In your layout you add the drawable as a background on the imageView.
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/photo"
android:background="@drawable/roundcorners"/>
Then you add this line in your Java code.
ImageView.setClipToOutline(true);
Note: this only works with level 21+