MainActivity.java
// 다이아로그
AlertDialog.Builder dialog = new AlertDialog.Builder(현재 액티비티.this);
// 다이아로그 세부 설정
dialog.setTitle("제목");
dialog.setIcon(R.mipmap.ic_launcher); // 제목 옆 아이콘 / api 25는 아이콘 그림이 mipmap 폴더에 있다
dialog.setNegativeButton("닫기", null);
// 보여주려는 다이아로그 레이아웃이 dialog.xml 이다. 객체로 만들어서 dialog.setView() 에 넣어줘야한다.
View dialogXmlToView = View.inflate(현재 액티비티.this, R.layout.dialog, null);
dialog.setView(dialogXmlToView);
// 다이아로그에 있는 이미지 뷰를 찾아옴
ImageView imageViewInDialog = (ImageView)dialogXmlToView.findViewById(R.id.iv_in_dialog);
// 찾아온 이미지 뷰에 이미지를 넣어줌
imageViewInDialog.setImageResource(R.mipmap.ic_launcher);
// 다이아로그 보여주세요
dialog.show();
dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_in_dialog"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>