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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:13:57+00:00 2026-05-26T10:13:57+00:00

Been trying to figure this out for a while now: I’m trying to create

  • 0

Been trying to figure this out for a while now:

I’m trying to create a custom dialog using the standard approach shown on the Dev site.

public class CustomDialog extends DialogFragment {    
    private OnDialogResultListener mOnDialogResultListener = null;
    public void setOnDialogResultListener(OnDialogResultListener dialogResultListener) {
        mOnDialogResultListener = dialogResultListener;
    }

    public static CustomDialog newInstance(OnDialogResultListener dialogResultListener) {
        CustomDialog frag = new CustomDialog();        
        frag.setOnDialogResultListener(dialogResultListener);
        return frag;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        getDialog().setTitle(getString(R.string.Dialog_CustomDialog_Title));
        View v = inflater.inflate(R.layout.customdialog, container, false);
        return v;
    }
}

With the XML being:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_height="fill_parent" android:background="@color/white" android:layout_margin="0px" android:layout_width="fill_parent">
    <EditText android:hint="@string/Dialog.CustomDialog.OldPassword" android:layout_marginBottom="@dimen/normalMargin" android:layout_height="wrap_content" android:inputType="textPassword" android:id="@+id/EditText02" android:layout_width="fill_parent"></EditText>
    <EditText android:hint="@string/Dialog.CustomDialog.NewPassword" android:layout_height="wrap_content" android:inputType="textPassword" android:id="@+id/EditText01" android:layout_width="fill_parent"></EditText>
    <EditText android:hint="@string/Dialog.CustomDialog.RetypePassword" android:layout_height="wrap_content" android:inputType="textPassword" android:id="@+id/editText1" android:layout_width="fill_parent">
        <requestFocus></requestFocus>
    </EditText>
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="fill_parent">
        <Button android:layout_height="wrap_content" android:text="@string/save" android:layout_width="@dimen/normalButtonWidth" android:id="@+id/btn_Custom_save"></Button>
        <Button android:layout_height="wrap_content" android:text="@string/cancel" android:layout_width="@dimen/normalButtonWidth" android:id="@+id/btn_Custom_cancel"></Button>
    </LinearLayout>
</LinearLayout>

And after creating and showing the dialog, I’m left with:
enter image description here

The white background has been applied to emphasize the unexpected and unwanted behavior.

Any ideas? I’ve tried changing width/heights, using weights in a horizontal LinearLayout, setting width/height programatically – all to no avail.

  • 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-26T10:13:58+00:00Added an answer on May 26, 2026 at 10:13 am

    I did come up with a cheap fix, which I would rather not have to use.

    Adding a 0px height, 2000dp (some huge number) width view anywhere in the layout causes it to fill the dialog frame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm been trying to figure this out for a while now, and have just
I have been trying to figure this out for a little while now and
I've been trying this for quite a while now, but can't figure it out.
Hey all. I've been been trying to figure this out for a while now.
I've been struggling for a while now trying to figure this out and I'm
I've been trying to figure this out for a while now and I need
I've been trying to figure this out for a while but now thought I
Been trying to figure this out for a while now. I am looking to
Okay I've been trying to figure this out for a while now. I have
I have been trying to figure this out for a while now and even

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.