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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:46:22+00:00 2026-06-10T20:46:22+00:00

I have been googling for a solution, and I only find solutions where FrameLayout

  • 0

I have been googling for a solution, and I only find solutions where FrameLayout or RelativeLayout is used, and I am using LinearLayout.

What I am trying to do is display an image in the foreground saying “please wait” before some things load on the page. And I am trying to have that image be centered, and not shift the other page elements around…so for that I guess I need it in the foreground, right?

How could I do this? Right now I have this:

<ImageView
    android:id="@+id/please_wait"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/please_wait"
    android:foregroundGravity="center|fill_horizontal" />

But it is not centering the image and isn’t putting it in the foreground.

Here is the whole xml file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >

<include android:id="@+id/header"
         layout="@layout/header"
         android:layout_height="wrap_content"
         android:layout_width="fill_parent"/>    

<ImageView
        android:id="@+id/please_wait"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/please_wait"
        android:foregroundGravity="center|fill_horizontal"
         />

<TextView
    android:id="@+id/problem_loading_prompt"    
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Getting the business(es) you are planning. They are stored in a database that is constantly backed up so you do not lose your work."
    />          

    <ListView
    android:id="@android:id/list"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+id/label"
        android:textSize="17sp"> 
    </ListView>

        <Button
    android:id="@+id/add_problem_ok"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textColor="@color/light_best_blue" 
    android:text="Plan a New Business"
    android:layout_marginTop ="15dp"    
    />  
</LinearLayout>

Thanks!

  • 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-10T20:46:24+00:00Added an answer on June 10, 2026 at 8:46 pm

    I think that the best way to display “please wait” message is just create Dialog. Here: http://developer.android.com/guide/topics/ui/dialogs.html you have good tutorial how to create a dialog. I think you can use AlertDialog with custom view, or ProgressDialog, because it has beauty spinner.

    Dialogs you call from java code, not from xml, so Dialog isn’t strict answer to your question, but I think that it is close to what you want.

    If you really want to do something like that in xml, I think you have to use FrameLayout, because it is designed to do something like that. Or you could try use RelativeLayout.

    EDIT:
    Here is sample code for create AlertDialog with your image:

    Dialog dialog = new Dialog(context);
    dialog.setContentView(R.layout.custom); 
    dialog.show(); //this will show dialog 
    dialog.dismiss(); //now dialog will disapear
    

    And here you have xml file named custom.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
    
    <ImageView
        android:id="@+id/please_wait"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/please_wait"/>
    
    </RelativeLayout>
    

    Of course you can use different layout also.

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

Sidebar

Related Questions

I have been googling around a bit and can't seem to find an solution.
I've been Googling for a while now trying to find some sort of solution
I have been googling for quite a long time but still find no solution.
I have been Googling a problem that I have with trying to integrate the
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been tracking emails for years using a "beacon" image and for those
I have been sick and tired Googling the solution for doing case-insensitive search on
I've been googling for a while but couldn't find a solution for my problem.
This question might have been answered, but I can't find a solution to my
Ive been googling for the last few hours to find a solution to my

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.