Question

I have a custom style file(style.xml) in res/values that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
        <item name="android:windowBackground">@null</item>
        <item name="android:windowNoTitle">true</item>
    </style>
</resources>

I made it specially for removing the default white frame of my dialog. But when I create the dialog object, Eclipse can,t find the style(CustomDialogTheme), as I supposed to pass it as the parameter of the Dialog Constructor(Dialog(getParent(),android.R.style.CustomDialogTheme)). I went one by one for the second parameter like Android.(then the menu comes up =>R.style.(now there is no style named CustomDialogTheme)).

What alternate should I use now and please don't suggest me to use AlertDialog as I already change it from AlertDialog to Dialog.

Was it helpful?

Solution

have you try with this

R.style.CustomDialogTheme only

Dialog(getParent(),R.style.CustomDialogTheme)

as android.R.style I think its define the predefine style into the android.R.style and whatever custom created layout, style or theme we use directly with the R.style which belongs to the current application

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top