查找原因是在activity java代码部分继承了compatactivity

public class DialogActivity extends AppCompatActivity

但是在AndroidManifest.xml里面确定义成Dialog,

<activity android:name=".DialogActivity"
android:theme="@android:style/Theme.Dialog">
</activity>

解决方法是修改activity java代码,继承Activity即可:

public class DialogActivity extends Activity