您需要在此活动中使用Theme.AppCompat主题(或后代)
Android Studio 0.4.5
用于创建自定义对话框的Android文档:http://developer.android.com/guide/topics/ui/dialogs.html
如果需要自定义对话框,则可以将“活动”显示为对话框,而不是使用“对话框API”。只需创建一个活动并将其主题设置为<activity>
清单元素中的Theme.Holo.Dialog :
<activity android:theme="@android:style/Theme.Holo.Dialog" >
但是,当我尝试这个时,我得到以下异常:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity
我支持以下内容,我不能使用大于10的内容:
minSdkVersion 10targetSdkVersion 19
在我的风格中,我有以下内容:
<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
在我的清单中,我有这个活动:
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:theme="@android:style/Theme.Holo.Light.Dialog" android:name="com.ssd.register.Dialog_update" android:label="@string/title_activity_dialog_update" > </activity>
像我这样创建对话框是我要做的事情,因为我已经完成了布局。
谁能告诉我如何解决这个问题?
海绵宝宝撒
当年话下