Android Studio 0.4.5
Android documentation for creating custom dialog boxes: 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. Simply create an activity and set its theme to Theme.Holo.Dialog in
the <activity>
manifest element:
<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:
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?
AppCompat
which is form the support library to support actionbars below api level 11. Just useandroid:theme="@style/AppTheme" >
for the activity in manifest – RaghunandanAndroidManifest.xml
, the theme you are specifying for your activity is overriding the theme you are specifying for your application. Remove theandroid:theme
line from the<activity>
tag. – cryptochronoconolite