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 7440657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:53:06+00:00 2026-05-29T10:53:06+00:00

I am developing a simple demo . Here in this demo, I am just

  • 0

I am developing a simple demo . Here in this demo, I am just creating one simple custom alert dialog . It works fine.

It shows me the perfect result when i build application in 1.6, but when i change the android version from 1.6 to 2.2, it shows the unexpected result. It doesn’t show the background screen on which i display the custom alert dialog.

Here is my xml file. Custom Dialog Theme File

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

Here is My CustomConfirmOkDialog Class

package com.utility.org;

import android.app.Activity;
import android.app.Dialog;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

    public class CustomConfirmOkDialog extends Dialog implements OnClickListener
    {
        private Button okButton = null;
        private TextView infoText=null,confirmBody=null;
        private int errorMessage=0;
        @SuppressWarnings("unused")
        private Activity activity;

        public CustomConfirmOkDialog(Activity context,int customdialogtheme,int errorMessage) 
        {
            super(context,customdialogtheme);
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            setContentView(R.layout.confirm_ok);
            this.errorMessage = errorMessage;
            this.activity = context;
            initControls();
        }

        private void initControls()
        {
            okButton = (Button) findViewById(R.id.ok_button);
            okButton.setOnClickListener(this);

            infoText = (TextView)findViewById(R.id.infoText);
            confirmBody = (TextView)findViewById(R.id.confirmBody);

            switch (this.errorMessage) 
            {

                case Utility.INVALID_USERNAME_PASSWORD:
                    try
                    {
                        infoText.setText(R.string.signIn);
                        confirmBody.setText(R.string.invalidUsernameAndPassword);
                    }
                    catch (Exception e) 
                    {
                        e.printStackTrace();
                    }
                    break;


                default:
                    break;
            }
        }
        public void onClick(View v) 
        {
            dismiss();
        }
    }

Calling this class from my main activity using the below code.

CustomConfirmOkDialog dialog = new CustomConfirmOkDialog(MainActivity.this, R.style.CustomDialogTheme, Utility.INVALID_USERNAME_PASSWORD);
dialog.show();

enter image description here
enter image description here

Here you can clearly notice that 1st image shows the background . Its build in android 1.6 version while 2nd image doesn’t shows the background . It shows the entire black screen. Its build in android version 2.2 . I am very thankful if anyone can solve this issue.

Can anyone help me to solve this simple and silly issue ?

Thanks in Advance.

  • 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-29T10:53:07+00:00Added an answer on May 29, 2026 at 10:53 am

    It resolved my problem by changing the following code in Custom Dialog Theme xml file.

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="CustomDialogTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
            <item name="android:windowFrame">@null</item>
            <item name="android:windowContentOverlay">@null</item>
            <item name="android:backgroundDimEnabled">true</item>
            <item name="android:windowIsTranslucent">true</item>
            <item name="android:windowNoTitle">true</item>
        </style>
    </resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am developing one simple application for android mobile here i am using two
I'm developing a simple Qt 4 app and making my own dialog. I subclassed
i'm developing a simple C# Editor for one of my university courses and I
I know many developers just do it like this: They start developing their app
Im developing a simple application that have a line like this: string[] values =
I developing a wide range of relatively simple firmware devices. Every one of these
i am developing simple game application just using pan gesture and cgaffinetransform rotate application
I am developing simple facebook canvas app. I was following this page in documentation:
I'm developing simple Silverlight 4 application based on one-to-many association. The model of relation
Can anyone recommend a good Java game engine for developing simple tile-based games? I'm

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.