Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6992075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:35:16+00:00 2026-05-27T19:35:16+00:00

I am currently having a big issue in my application. I use the Theme.Light

  • 0

I am currently having a big issue in my application.
I use the Theme.Light in my whole application. The result is great, but I noticed that in ICS, the Dialog have white background, and in previous versions, the background was black (see screenshot below)

My first idea was to use different layout for the items and use layout-v14 with dark text and layout folder with white text.

That will be working but I really would like to set the theme of the Dialog like I do with classic dialog:

return new AlertDialog.Builder(AlertDialogSamples.this, AlertDialog.THEME_TRADITIONAL)
.create();

The problem is now that my custom Dialog extends Dialog and I have no more the possibility to play with the builder:

public class MyCustomDialog extends Dialog implements OnClickListener {

    int THEME=AlertDialog.THEME_TRADITIONAL;

    public MyCustomDialog(Activity plannerActivity) {
        super(plannerActivity);
        View myView=//Something;
        setContentView(myView);
    }
}

and in my main code:

new MyCustomDialog(getActivity()).show();

As I have no more access to the builder, I cannot change the Theme of my CustomDialog and I am completely stuck in my app.

Thank a lot for any help!

enter image description here

EDIT TO ADD MORE INFO

As advised by Vineet Shukla, I tried new DialogYour(Activity.this, android.R.style.Theme_Translucent_NoTitleBar), but the constructor DialogYour(Activity, int) is undefined.

I cannot override the DialogYour with a theme, as some stuff are internal to android!

When I look into the Dialog Code:

Dialog(Context context, int theme, boolean createContextWrapper) {
    if (theme == 0) {
        TypedValue outValue = new TypedValue();
        context.getTheme().resolveAttribute(com.android.internal.R.attr.dialogTheme,
                outValue, true);
        theme = outValue.resourceId;
    }

    mContext = createContextWrapper ? new ContextThemeWrapper(context, theme) : context;
    mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
    Window w = PolicyManager.makeNewWindow(mContext);
    mWindow = w;
    w.setCallback(this);
    w.setWindowManager(mWindowManager, null, null);
    w.setGravity(Gravity.CENTER);
    mUiThread = Thread.currentThread();
    mListenersHandler = new ListenersHandler(this);
}

I cannot override, because PolicyManager belong to com.android.internal

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:35:17+00:00Added an answer on May 27, 2026 at 7:35 pm

    I have tried custom dialog but not this way. I have overridden the onCreateDialog in the activity like this with theme android.R.style.Theme_Translucent_NoTitleBar

    protected Dialog onCreateDialog(int id) {
    Dialog dialog = new DialogYour(Activity.this, android.R.style.Theme_Translucent_NoTitleBar);
    if(id == YOUR_ID){
        dialog.setContentView(R.layout.layout);
        //initialize your views here ...
    }
    
    return dialog;  
    }
    

    You can try this way and you will achieve your desired layout for custom layout.

    Note: You can also try with the theme android.R.style.Theme_Translucent_NoTitleBar in your code.

    Edit1:

    I have not tried but To set the theme in your case you can try like this:

    ConnectionDialog dialog = new ConnectionDialog(getActivity()); 
    dialog.getWindow().getAttributes().windowAnimations = android.R.style.Theme_Translucent_NoTitleBar;
    dialog.show();
    

    Edit2: I have tested your code and the issue was in your constructor.

    public class MyCustomDialog extends Dialog implements OnClickListener {
    
        int THEME=AlertDialog.THEME_TRADITIONAL;
    
        public MyCustomDialog(Context context, int theme) {
            super(context, theme);
            View myView=//Something;
            setContentView(myView);
        }
    }
    

    now call the above dialog like this:

     MyCustomDialog dialog = new MyCustomDialog (this, android.R.style.Theme_Translucent_NoTitleBar);
        dialog.show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I'm having a big issue with my android App. I'm currently updating it
I'm currently having a major issue with a python script. The script runs arbitrary
Hi All I am currently having an issue calling a WCF service from a
I'm working on a complex application, and I'm having an issue with a listbox
I'm having a big problem when calling a web service from my WPF application.
I’m from a .NET background and now dabbling in Java. Currently, I’m having big
We currently have a big Maven 2 project that is rather a collection of
I'm having a big issue with a static HTTPS connection method. Every second request
I'm having a strange issue that I haven't encountered before. I'm working on the
I am currently developing a WebGL-based application, and I am having some trouble with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.