2

i'm using custom style for my activity, it's affect the dialog (alertdialog, DatePickerDialog, etc) using that style too. how can i avoid alertdialog to not using the same style with activity ??

this is the code in style.xml :

    <style name="Custom.Theme" parent="@android:style/Theme.Dialog">
        <item name="android:background">@color/cag_white</item>
        <item name="android:textColor">@color/cag_orange</item>
        <item name="android:textViewStyle">@style/Cag.Dialog.TextView</item>
        <item name="android:editTextStyle">@style/Cag.EditText</item>
        <item name="android:buttonStyle">@style/Cag.Button</item>
    </style>

enter image description here

Khairil Ushan
  • 2,128
  • 4
  • 22
  • 28

1 Answers1

1

You can specify the theme for your dialog the way you want it. Check the examples from here or here.

However, I personally prefer to use DialogFragments and set the styling myself through onCreateView.

Community
  • 1
  • 1
gunar
  • 14,392
  • 7
  • 54
  • 83
  • great , this link > http://stackoverflow.com/questions/2422562/how-to-change-theme-for-alertdialog work for me . thanks @gunar . :) – Khairil Ushan Jul 26 '13 at 07:26