Android Studio 0.4.5
(Android Studio 0.4.5)
Android documentation for creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.html
(用于创建自定义对话框的Android文档: http : //developer.android.com/guide/topics/ui/dialogs.html)
If you want a custom dialog, you can instead display an Activity as a dialog instead of using the Dialog APIs.
(如果需要自定义对话框,则可以将“活动”显示为对话框,而不是使用Dialog API。)
Simply create an activity and set its theme to Theme.Holo.Dialog in the <activity>
manifest element: (只需创建一个活动并将其主题设置为<activity>
清单元素中的Theme.Holo.Dialog即可:)
<activity android:theme="@android:style/Theme.Holo.Dialog" >
However, when I tried this I get the following exception:
(但是,当我尝试此操作时,出现以下异常:)
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity
I am supporting the following, and I can't using something greater than 10 for the min:
(我支持以下内容,并且我不能使用大于10的值:)
minSdkVersion 10
targetSdkVersion 19
In my styles I have the following:
(我的风格如下:)
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
And in my manifest I have this for the activity:
(在清单中,我有此活动:)
<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>
Creating the dialog box like this was something I was hopping to do, as I have already completed the layout.
(像这样创建对话框是我希望做的事情,因为我已经完成了布局。)
Can anyone tell me how I can get around this problem?
(谁能告诉我如何解决这个问题?)
ask by ant2009 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…