in Education by
(This is a random image of showing a Dialog found on the Internet.) I've been implementing a custom Dialog. I could handle almost everything on the dialog except for that default black dim background under the dialog itself, but over the entire screen behind it. Basically I want to change its color and alpha value. I've been wandering through StackOverflow but only answers I found were about changing background of Dialog itself. In any case if you need it, here's my simple codes. CustomDialog.java public class HTDialog extends Dialog{ public HTDialog(Context context, boolean cancelable, OnCancelListener cancelListener) { super(context, cancelable, cancelListener); requestWindowFeature(Window.FEATURE_NO_TITLE); setCanceledOnTouchOutside(true); setContentView(R.layout.custom_dialog); } } custom_dialog.xml JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
This is a workaround but it's not really a pure solution because background touch is disabled and should be configured manually. First, set custom dialog theme like this. styles.xml true false @android:color/transparent Setting windowIsFloating to false forces Dialog view to be expanded to full screen. Setting windowBackground to transparent removes default black dim background under Dialog. windowNoTitle option gets rid of the upper title bar. CustomDialog.java Apply the theme and construct your custom_dialog view as follows. public HTCustomDialog(Context context) { super(context, R.style.CustomDialogTheme); setContentView(R.layout.custom_dialog); } custom_dialog.xml Now that CustomDialog view is a full-screen view, set background of your root layout to whatever color you'd like. Sample result I mosaiced the result a bit.

Related questions

0 votes
    I am trying to display a DatePicker dialog on top of another activity and what is happening is it is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    What is not true in context of HTML tag ? O Table cell changes its width automatically based on content O We can ... table border is o Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    i want to run a task every 5 minutes. i've tried to solve it with an IntentService and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    I'm working on this project and I required to allow the user to select a color from the color ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    The text on my buttons are set in resource files. E.g. The above code defines a button with text ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    Is it possible to change the background color of a radio button input in Firefox/Chrome like in IE? (Without using images) Run this in both IE(...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    is it possible to change the background color of job designer in Talend?...
asked Mar 16, 2021 in Technology by JackTerrance
0 votes
    See the picture below. In my application (with MapView) usage, I would like to use such default markers ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I understand that export=true will set the content provider to be readable and writable by all other apps. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Let's say I have this variable: long myMillis = 20000; This means that I want my Chronometer to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have an activity A that launches B with an Intent. (B is a MapActivity and has some async code ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I'm designing a service that will comprise a cloud-based database (with a UI for us to manage the data), ... sit behind mobile apps. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    My code: PhoneAuthProvider.getInstance().verifyPhoneNumber( phoneNumber, // Phone number to verify 60, // Timeout ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I am trying to build a mailto: uri to send a mail using the GMail app. I would like to use the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I'm looking at making an custom Android object Serializable. Should be simple I just cannot find a easy ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
...