-2

I am using this theme @android:style/Theme.Black.NoTitleBar for my application. the alert dialogue that shows looks very ugly and I don't want to do anything custom. How can I use the holo theme for the alert dialogue only?

thank you,

infinite_loop_
  • 179
  • 1
  • 11
  • 1
    possible duplicate http://stackoverflow.com/questions/20796049/changing-theme-of-android-dialog/20796074#20796074 in that use AlertDialog instead of Dialog – kalyan pvs May 08 '14 at 06:19
  • 1
    pass the theme to constructor of `Dialog`... `AlertDialog.Builder builder = new AlertDialog.Builder(this, android.R.style.Theme_Holo_Dialog);` – Gopal Gopi May 08 '14 at 06:19
  • it doesn't work for api<11 :( – infinite_loop_ May 08 '14 at 06:23
  • possible duplicate of [How to change theme for AlertDialog](http://stackoverflow.com/questions/2422562/how-to-change-theme-for-alertdialog) – canova May 08 '14 at 06:27
  • why the downvote? all the answers don't solve the problem for api<11. the only answer that solve this problem uses something custom. anyway I found a solution. – infinite_loop_ May 08 '14 at 06:35

1 Answers1

0

I found the solution for api < 11 using @Gopal's answer

AlertDialog.Builder builder=null;
if(android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.HONEYCOMB)
{ builder= new AlertDialog.Builder(this, android.R.style.Theme_Holo_Dialog_NoActionBar); }
else
{ builder= new AlertDialog.Builder(this); } 

thank you,

infinite_loop_
  • 179
  • 1
  • 11