Error inflating class is reported when R.layout.dialog_item contains theme when filling the layout
LayoutInflater inflater = LayoutInflater.from(mContext);
View view = inflater.inflate(R.layout.dialog_item, null);
There is a theme in the layout, you need to add it to the corresponding AndroidManifest, and add the theme to the activity
<activity
android:name=".MyActivity"
android:theme="@style/SampleTheme.Light"/>
This will solve it