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

  • SEARCH
  • Home
  • 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 8096813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:33:58+00:00 2026-06-05T21:33:58+00:00

I am making a dialog to overlay upon the screen when the phone needs

  • 0

I am making a dialog to overlay upon the screen when the phone needs to retrieve some data from a web service, problem is it is acting really weird:

Size problem on the dialog

Why isn’t the imageView (width and height set to **fill_parent)** filling up the whole space assigned to the alert?


Here’s the code that displays the alert:

public class WaitDialog {

private static AlertDialog dialog;

public static void show(Activity pariente) {
    WindowManager.LayoutParams sizeParams = new WindowManager.LayoutParams();
    parametrosTamano.height = 128;
    parametrosTamano.width = 128;
    LayoutInflater inflater = (LayoutInflater)pariente.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View content = inflater.inflate(R.layout.waitingdialog, null);
    ImageView animation = (ImageView)contenido.findViewById(R.id.waitpic);
    animacion.startAnimation(AnimationUtils.loadAnimation(pariente, R.anim.animacionespera));
    AlertDialog.Builder builder = new AlertDialog.Builder(pariente);
    builder.setView(content);
    builder.setCancelable(false);
    dialog = constructor.create();
    dialog.show();
    //sizeParams.copyFrom(dialog.getWindow().getAttributes());
    dialog.getWindow().setAttributes(sizeParams);
    //dialog.getWindow().setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
}

public static void hide() {
    dialog.hide();
    dialog.dismiss();
    dialog = null;
}
}

Here’s the XML being inflated:

<ImageView 
    android:id="@+id/imagenEspera"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
    android:src="@drawable/animespera"
    android:scaleType="fitXY"
    android:layout_centerInParent="true"
    android:contentDescription="@string/espera"/>

Am i doing something wrong? Is there a better way to do this?

NOTE: Can someone fix the above mess please?

  • 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-06-05T21:34:00+00:00Added an answer on June 5, 2026 at 9:34 pm

    Hello Drknezz,

              Please make the Layout for showing Alert and through Layout inflater show the alert. Like this
    
    final Dialog _contiDialog=new Dialog(Qualify2.this,android.R.style.Theme_Translucent_NoTitleBar);
    _contiDialog.setContentView(R.layout.continuedilog);
    

    continuedilog.xml

    <?xml version="1.0" encoding="utf-8"?>
    

    <TextView android:id="@+id/TextView01" 
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  android:text="Submit Your Score" 
                  android:textStyle="bold"
                  android:paddingTop="10dip"
                  android:textColor="#000"/>
    
    <LinearLayout 
                  android:gravity="center" 
                  android:layout_gravity="center_vertical|center_horizontal"
                  android:layout_height="wrap_content"
                  android:layout_width="fill_parent"
                  android:paddingTop="10dip"
                  android:orientation="vertical">
    
    <RelativeLayout 
                   android:paddingLeft="20dip"
                   android:paddingRight="20dip"
                   android:layout_height="wrap_content"
                   android:layout_width="fill_parent">
    
    
       <TextView android:id="@+id/TextView02" 
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content" 
                 android:layout_below="@+id/TextView01"
                 android:textColor="#000" 
                 android:text="Initial:"
                  android:layout_alignParentLeft="true"
                 android:textStyle="bold"/>
    
        <EditText 
                  android:layout_width="150dip" 
                  android:layout_height="35dip" 
                  android:id="@+id/initials"
                  android:layout_alignParentRight="true"
                  android:textSize="12dip"
                  android:singleLine="true" />
    
    </RelativeLayout>
    
    
    <RelativeLayout 
                  android:gravity="center_horizontal|center_vertical"
                  android:paddingLeft="20dip"
                  android:paddingRight="20dip"
                  android:layout_height="wrap_content"
                  android:layout_width="fill_parent">
    
        <TextView android:id="@+id/TextView03" 
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  android:textColor="#000"
                  android:textStyle="bold"
                  android:layout_alignParentLeft="true"
                  android:text="Email: "/>
    
        <EditText 
                  android:id="@+id/emails" 
                  android:layout_width="150dip"
                  android:layout_height="35dip"
                  android:singleLine="true" 
                  android:layout_alignParentRight="true"
                  android:textSize="12dip"/>
    
    </RelativeLayout>
    <RelativeLayout 
                 android:gravity="center_horizontal|center_vertical" 
                  android:layout_height="wrap_content"
                  android:layout_width="fill_parent"
                   android:paddingLeft="20dip"
                  android:paddingRight="20dip">
    
        <TextView android:id="@+id/TextView04" 
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  android:layout_below="@+id/TextView03"
                  android:textColor="#000"
                  android:text="Smartphone:"
                   android:layout_alignParentLeft="true"
                  android:textStyle="bold"/>
    
        <Spinner android:prompt="@string/planet_prompt"
                 android:id="@+id/smart_phone"
                 android:layout_width="150dip" 
                 android:layout_height="35dip"
                  android:layout_alignParentRight="true"
                 android:layout_below="@+id/emails"/>
    
    
    </RelativeLayout>                         
    
    <RelativeLayout 
                 android:gravity="center_horizontal|center_vertical" 
                  android:layout_height="wrap_content"
                  android:layout_width="fill_parent"
                   android:paddingLeft="20dip"
                  android:paddingRight="20dip">
    
        <TextView android:id="@+id/TextView05" 
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  android:textColor="#000" 
                  android:text="Country: " 
                   android:layout_alignParentLeft="true"
                  android:textStyle="bold"/>
    
        <Spinner android:prompt="@string/planet_prompt1"
                 android:id="@+id/country"
                 android:layout_width="150dip" 
                  android:layout_alignParentRight="true"
                 android:layout_height="35dip"/>          
    </RelativeLayout>
    
    <CheckBox android:id="@+id/term1" android:layout_width="wrap_content"
        android:background="@drawable/checkbox_background"
        android:button="@drawable/checkbox"
        android:text="I accept the Terms and Conditions of this service. I know I will be sending my initials,email address, my handset model details,and my score to QuickNimble."
        android:textColor="#000" 
        android:layout_height="wrap_content" 
        android:textSize="12sp" 
        android:layout_marginLeft="9dip"></CheckBox>
    
    <TextView android:layout_width="wrap_content"
                  android:layout_height="10dip"/>
    
    <CheckBox android:id="@+id/term2" 
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" 
              android:background="@drawable/checkbox_background"
              android:button="@drawable/checkbox"
              android:text="I would like to receive more information and offers from QuickNimble."
              android:textColor="#000" 
              android:textSize="12sp"
              android:layout_marginLeft="9dip"/>
    

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

Sidebar

Related Questions

I am making an application that fetches data from internet like web service,so it
I'm making a partial overlay modal in my app with the code from Semi-Modal
I have a jQuery dialog for making links in a contentEditable span. The problem
I'm making a non-rectangular dialog, modelled over an image from Photoshop (the image is
I ma making a game, and I want to pull the apprpriate dialog from
Which do you think are best practices for making a windows dialog compatible both
I'm making a custom error dialog in my WPF app and I want to
I'm concerned that when I use Facebook's feed dialog I'm making my App Id
So, I'm busy making a model viewer, I'm trying to get my dialog properly
Making an adobe flex ui in which data that is calculated must use proprietary

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.